TVB-2639 adapt Allen Creator to the new api
Created by: adrian-dordea
Add model to Allen Creator and init form + fix launch and residual python 2 code left over
Merge request reports
Activity
Filter activity
94 required=True, 95 doc="""To build the volume and the connectivity select only the areas that have a volume 96 greater than (micron^3): """) 97 98 vol_thresh = Float( 99 label="Min volume", 100 default=1000000000, 101 required=True, 102 doc="""To build the connectivity select only the experiment where the percentage of infected voxels 103 in the injection structure is greater than: """) 58 104 59 105 class AllenConnectomeBuilderForm(ABCAdapterForm): 60 106 107 def __init__(self, prefix='', project_id=None): 108 super(AllenConnectomeBuilderForm, self).__init__(prefix, project_id) 109 self.resolution = SelectField(AllenConnectModel.resolution, self, choices=RESOLUTION_OPTIONS) 668 735 # the relation between the different reference system is: x1=z2, y1=x2, z1=y2 669 736 def rotate_reference(allen): 670 737 # first rotation in order to obtain: x1=x2, y1=z2, z1=y2 671 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=float) 738 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=int) 668 735 # the relation between the different reference system is: x1=z2, y1=x2, z1=y2 669 736 def rotate_reference(allen): 670 737 # first rotation in order to obtain: x1=x2, y1=z2, z1=y2 671 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=float) 738 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=int) 672 739 for x in range(allen.shape[0]): 673 740 vol_trans[x, :, :] = (allen[x, :, :][::-1]).transpose() 674 741 675 742 # second rotation in order to obtain: x1=z2, y1=x1, z1=y2 676 allen_rotate = np.zeros((allen.shape[2], allen.shape[0], allen.shape[1]), dtype=float) 743 allen_rotate = np.zeros((allen.shape[2], allen.shape[0], allen.shape[1]), dtype=int) 668 735 # the relation between the different reference system is: x1=z2, y1=x2, z1=y2 669 736 def rotate_reference(allen): 670 737 # first rotation in order to obtain: x1=x2, y1=z2, z1=y2 671 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=float) 738 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=int) 668 735 # the relation between the different reference system is: x1=z2, y1=x2, z1=y2 669 736 def rotate_reference(allen): 670 737 # first rotation in order to obtain: x1=x2, y1=z2, z1=y2 671 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=float) 738 vol_trans = np.zeros((allen.shape[0], allen.shape[2], allen.shape[1]), dtype=int) 672 739 for x in range(allen.shape[0]): 673 740 vol_trans[x, :, :] = (allen[x, :, :][::-1]).transpose() 674 741 675 742 # second rotation in order to obtain: x1=z2, y1=x1, z1=y2 676 allen_rotate = np.zeros((allen.shape[2], allen.shape[0], allen.shape[1]), dtype=float) 743 allen_rotate = np.zeros((allen.shape[2], allen.shape[0], allen.shape[1]), dtype=int)
Please register or sign in to reply