Skip to content
Snippets Groups Projects

TVB-2639 adapt Allen Creator to the new api

Merged Marmaduke Woodman requested to merge TVB-2639 into master

Created by: adrian-dordea

Add model to Allen Creator and init form + fix launch and residual python 2 code left over

Merge request reports

Merged by (Jan 9, 2025 3:02pm UTC)

Merge details

  • Changes merged into with 3c0bf36f.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
55 60
56 61 LOGGER = get_logger(__name__)
57 62
63 RESOLUTION_OPTIONS = {
64 '25': '25',
65 '50': '50',
66 '100': '100'
67 }
  • Marmaduke Woodman
  • Marmaduke Woodman
  • Marmaduke Woodman
  • Marmaduke Woodman
    Marmaduke Woodman @woodman started a thread on commit 3c0bf36f
  • 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)
  • Marmaduke Woodman
  • Marmaduke Woodman
  • Marmaduke Woodman
    Marmaduke Woodman @woodman started a thread on commit 3c0bf36f
  • 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)
  • Marmaduke Woodman
    Marmaduke Woodman @woodman started a thread on commit 3c0bf36f
  • 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)
  • Marmaduke Woodman
  • Marmaduke Woodman
    Marmaduke Woodman @woodman started a thread on commit 3c0bf36f
  • 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)
    • Created by: adrian-dordea

      the change was made here and in the review below from float to int because otherwise we would get a error on RegionVolumeMapping.array_data that says : "can't be set to an array of dtype float64" the fix to int solves this problem

  • Marmaduke Woodman
  • Marmaduke Woodman
    Marmaduke Woodman @woodman started a thread on commit 3c0bf36f
  • 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