junifer 0.0.6.dev330__py3-none-any.whl → 0.0.6.dev335__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
junifer/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.0.6.dev330'
16
- __version_tuple__ = version_tuple = (0, 0, 6, 'dev330')
15
+ __version__ = version = '0.0.6.dev335'
16
+ __version_tuple__ = version_tuple = (0, 0, 6, 'dev335')
@@ -125,7 +125,7 @@ class ANTsMaskWarper:
125
125
  # Get template space image
126
126
  template_space_img = get_template(
127
127
  space=dst,
128
- target_data=target_data,
128
+ target_img=mask_img,
129
129
  extra_input=None,
130
130
  )
131
131
  # Save template to a tempfile
@@ -106,15 +106,15 @@ def compute_brain_mask(
106
106
  if entry["dst"] == "native":
107
107
  target_std_space = entry["src"]
108
108
 
109
+ target_img = target_data["data"]
109
110
  # Fetch template in closest resolution
110
111
  template = get_template(
111
112
  space=target_std_space,
112
- target_data=target_data,
113
+ target_img=target_img,
113
114
  extra_input=extra_input,
114
115
  template_type=mask_type,
115
116
  )
116
117
  # Resample template to target image
117
- target_img = target_data["data"]
118
118
  resampled_template = resample_to_img(
119
119
  source_img=template, target_img=target_img
120
120
  )
@@ -131,7 +131,7 @@ class ANTsParcellationWarper:
131
131
  # Get template space image
132
132
  template_space_img = get_template(
133
133
  space=dst,
134
- target_data=target_data,
134
+ target_img=parcellation_img,
135
135
  extra_input=None,
136
136
  )
137
137
  # Save template to a tempfile
@@ -122,7 +122,7 @@ def get_xfm(
122
122
 
123
123
  def get_template(
124
124
  space: str,
125
- target_data: dict[str, Any],
125
+ target_img: nib.Nifti1Image,
126
126
  extra_input: Optional[dict[str, Any]] = None,
127
127
  template_type: str = "T1w",
128
128
  ) -> nib.Nifti1Image:
@@ -132,9 +132,9 @@ def get_template(
132
132
  ----------
133
133
  space : str
134
134
  The name of the template space.
135
- target_data : dict
136
- The corresponding item of the data object for which the template space
137
- will be loaded.
135
+ target_img : Nifti1Image
136
+ The corresponding image for which the template space will be loaded.
137
+ This is used to obtain the best matching resolution.
138
138
  extra_input : dict, optional
139
139
  The other fields in the data object. Useful for accessing other data
140
140
  types (default None).
@@ -163,7 +163,6 @@ def get_template(
163
163
  raise_error(f"Unknown template type: {template_type}")
164
164
 
165
165
  # Get the min of the voxels sizes and use it as the resolution
166
- target_img = target_data["data"]
167
166
  resolution = np.min(target_img.header.get_zooms()[:3]).astype(int)
168
167
 
169
168
  # Fetch available resolutions for the template
@@ -61,7 +61,9 @@ def test_get_template(template_type: str) -> None:
61
61
  bold = element_data["BOLD"]
62
62
  # Get tailored parcellation
63
63
  tailored_template = get_template(
64
- space=bold["space"], target_data=bold, template_type=template_type
64
+ space=bold["space"],
65
+ target_img=bold["data"],
66
+ template_type=template_type,
65
67
  )
66
68
  assert isinstance(tailored_template, nib.Nifti1Image)
67
69
 
@@ -74,7 +76,7 @@ def test_get_template_invalid_space() -> None:
74
76
  vbm_gm = element_data["VBM_GM"]
75
77
  # Get tailored parcellation
76
78
  with pytest.raises(ValueError, match="Unknown template space:"):
77
- get_template(space="andromeda", target_data=vbm_gm)
79
+ get_template(space="andromeda", target_img=vbm_gm["data"])
78
80
 
79
81
 
80
82
  def test_get_template_invalid_template_type() -> None:
@@ -87,7 +89,7 @@ def test_get_template_invalid_template_type() -> None:
87
89
  with pytest.raises(ValueError, match="Unknown template type:"):
88
90
  get_template(
89
91
  space=vbm_gm["space"],
90
- target_data=vbm_gm,
92
+ target_img=vbm_gm["data"],
91
93
  template_type="xenon",
92
94
  )
93
95
 
@@ -100,5 +102,7 @@ def test_get_template_closest_resolution() -> None:
100
102
  vbm_gm = element_data["VBM_GM"]
101
103
  # Change header resolution to fetch closest resolution
102
104
  element_data["VBM_GM"]["data"].header.set_zooms((3, 3, 3))
103
- template = get_template(space=vbm_gm["space"], target_data=vbm_gm)
105
+ template = get_template(
106
+ space=vbm_gm["space"], target_img=vbm_gm["data"]
107
+ )
104
108
  assert isinstance(template, nib.Nifti1Image)
@@ -189,7 +189,7 @@ class ANTsWarper:
189
189
  # Get template space image
190
190
  template_space_img = get_template(
191
191
  space=reference,
192
- target_data=input,
192
+ target_img=input["data"],
193
193
  extra_input=None,
194
194
  )
195
195
  # Save template
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: junifer
3
- Version: 0.0.6.dev330
3
+ Version: 0.0.6.dev335
4
4
  Summary: JUelich NeuroImaging FEature extractoR
5
5
  Author-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
6
6
  Maintainer-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
@@ -1,6 +1,6 @@
1
1
  junifer/__init__.py,sha256=2McgH1yNue6Z1V26-uN_mfMjbTcx4CLhym-DMBl5xA4,266
2
2
  junifer/__init__.pyi,sha256=SsTvgq2Dod6UqJN96GH1lCphH6hJQQurEJHGNhHjGUI,508
3
- junifer/_version.py,sha256=ib7p2sRvl9n6dHPTqNlqVwUPPOKf5EKIksHMk7EQqno,428
3
+ junifer/_version.py,sha256=wpXWesraPrhb_cofYpN1ctRb0HDonccBP0feD-Khgm0,428
4
4
  junifer/conftest.py,sha256=PWYkkRDU8ly2lYwv7VBKMHje4et6HX7Yey3Md_I2KbA,613
5
5
  junifer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  junifer/stats.py,sha256=e9aaagMGtgpRfW3Wdpz9ocpnYld1IWylCDcjFUgX9Mk,6225
@@ -75,7 +75,7 @@ junifer/data/__init__.pyi,sha256=qYszjUYcbFi_2zO23MnbA2HhTW-Ad2oh1pqPQYd6yt0,542
75
75
  junifer/data/_dispatch.py,sha256=O524U1R4MtbGhGJsL0HSh9EqisapBFJWK7uupXrJuMg,6158
76
76
  junifer/data/pipeline_data_registry_base.py,sha256=G8bE3WTj4D_rKC4ZKZe6E48Sd96CGea1PS3SxmTgGK4,2010
77
77
  junifer/data/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
- junifer/data/template_spaces.py,sha256=AVNuXuCqY0w7dSrVOZURjCPFIkg0wzQsAV2ggtQFpJU,6504
78
+ junifer/data/template_spaces.py,sha256=JPsrGyfbaVgZ75uB3ci2CUuVxUg3NDi6HhO_VTIHeOE,6508
79
79
  junifer/data/utils.py,sha256=5r-0QGQCNZvDM1tVcl9xyrIdgAO85mww0plpM1RUaGA,3247
80
80
  junifer/data/coordinates/__init__.py,sha256=ffM8rwcHLgHAWixJbKrATrbUKzX940V1UF6RAxZdUMg,186
81
81
  junifer/data/coordinates/__init__.pyi,sha256=Z-Ti5XD3HigkZ8uYN6oYsLqw40-F1GvTVQ5QAy08Wng,88
@@ -104,9 +104,9 @@ junifer/data/coordinates/VOIs/meta/extDMN_VOIs.txt,sha256=Ogx1QvqZcnXDM3ncF2ha78
104
104
  junifer/data/coordinates/tests/test_coordinates.py,sha256=_c2P4oaDGpsmui5gJBe_jN6HLGiKxONkYPR69sRBUlU,4219
105
105
  junifer/data/masks/__init__.py,sha256=eEEhHglyVEx1LrqwXjq3cOmjf4sTsgBstRx5-k7zIQU,180
106
106
  junifer/data/masks/__init__.pyi,sha256=lcgr8gmWDPibC4RxnWBXb8DDpIkO73Aax09u6VXiJJI,114
107
- junifer/data/masks/_ants_mask_warper.py,sha256=6ex2jxxKI5yA4G1rebSpcAYGGisflVK-DwhtUtWY964,5348
107
+ junifer/data/masks/_ants_mask_warper.py,sha256=CLZ6f8jp2PE1F8uHSrSYZ5wW8Nz0aeg84vStIpz0L2Y,5344
108
108
  junifer/data/masks/_fsl_mask_warper.py,sha256=VApp-ofGBKePNmCdgTg1HoEA66lMQiAPT0ihkhB2ezY,2415
109
- junifer/data/masks/_masks.py,sha256=96NKsSSosD6r03Jb2N1xQoyOc2Vl5miokcQdSeuM6SY,20729
109
+ junifer/data/masks/_masks.py,sha256=W-vl1CTr5MHg5mvm51sObE4mqKR5f6RD6eE2wzCHRVc,20727
110
110
  junifer/data/masks/tests/test_masks.py,sha256=1Zm09ZSdUlR278DTCZeVuxuQntryefsnYYPP02MttVE,16120
111
111
  junifer/data/masks/ukb/UKB_15K_GM_template.nii.gz,sha256=jcX1pDOrDsoph8cPMNFVKH5gZYio5G4rJNpOFXm9wJI,946636
112
112
  junifer/data/masks/vickery-patil/CAT12_IXI555_MNI152_TMP_GS_GMprob0.2_clean.nii.gz,sha256=j6EY8EtRnUuRxeKgD65Q6B0GPEPIALKDJEIje1TfnAU,88270
@@ -114,12 +114,12 @@ junifer/data/masks/vickery-patil/CAT12_IXI555_MNI152_TMP_GS_GMprob0.2_clean_3mm.
114
114
  junifer/data/masks/vickery-patil/GMprob0.2_cortex_3mm_NA_rm.nii.gz,sha256=jfMe_4H9XEnArYms5bSQbqS2V1_HbLHTfI5amQa_Pes,8700
115
115
  junifer/data/parcellations/__init__.py,sha256=6-Ysil3NyZ69V6rWx4RO15_d-iDKizfbHuxSjsHNt24,188
116
116
  junifer/data/parcellations/__init__.pyi,sha256=lhBHTbMDizzqUqVHrx2eyfPFodrTBgMFeTgxfESSkQ8,140
117
- junifer/data/parcellations/_ants_parcellation_warper.py,sha256=4CYieBer6ow4i8o4NjKsfufc96XdtsMGwfBbMF-Kw78,5802
117
+ junifer/data/parcellations/_ants_parcellation_warper.py,sha256=YUCJC0_wutGw7j_n9JRU3LCwm9Ttg5PIlJUgqejfRhs,5806
118
118
  junifer/data/parcellations/_fsl_parcellation_warper.py,sha256=JfJ022flg5OR48P4OAALVHHQgTVxdMBXT-fAqBl3nUM,2679
119
119
  junifer/data/parcellations/_parcellations.py,sha256=uOqoucoynv--iEftrhdnOd3jBcqq9PSDgs9DYhbeN24,65611
120
120
  junifer/data/parcellations/tests/test_parcellations.py,sha256=crluGgUjocVZ0ZIkMpUVol27A-Px6oc2eflY5g0C4BY,38315
121
121
  junifer/data/tests/test_data_utils.py,sha256=136iGPjGecCxyqgUwU8VZMHoE6imcYJ0WNC32PDGK4g,1063
122
- junifer/data/tests/test_template_spaces.py,sha256=PJulN7xHpAcSOTY-UzTG_WPywZEBSlAZGiNG4gzk1_8,3144
122
+ junifer/data/tests/test_template_spaces.py,sha256=ZEicEcLqOJ-NpuBZ5SYh4yZ0xZRkhYHnYXiC_YSxjrY,3219
123
123
  junifer/datagrabber/__init__.py,sha256=EHIK-lbjuvkt0V8ypFvLSt85OAAXSkaxBmVlCbNNz8M,323
124
124
  junifer/datagrabber/__init__.pyi,sha256=zOQE4TaCKXBTHnNqgmECtsszWIOHYiQ1CUEeXXFU9F4,832
125
125
  junifer/datagrabber/base.py,sha256=a3_fUZIN5Bqhq2f4ldpwk_eWeSVRDpDmx2QGIKzCtkg,6761
@@ -294,7 +294,7 @@ junifer/preprocess/smoothing/tests/test_smoothing.py,sha256=t1j3zEvJk5XLO4fzcb-w
294
294
  junifer/preprocess/tests/test_preprocess_base.py,sha256=-0rpe8QjqYES36H6MHuDs3cv_6upHBdVHnFMgQsmEX4,2571
295
295
  junifer/preprocess/warping/__init__.py,sha256=rzUUP7-6H_nygQ7a7TBZ4_RY7p0ELacosYsWQbSdVZk,214
296
296
  junifer/preprocess/warping/__init__.pyi,sha256=Drbqp8N3uprvXcKSxqdfj90fesz9XYVLgivhPnKAYcc,65
297
- junifer/preprocess/warping/_ants_warper.py,sha256=Qk6piCuGPlfgGbH3zMVC5UHCoQ7iddYuc2vgsrqncGg,10163
297
+ junifer/preprocess/warping/_ants_warper.py,sha256=8-YzQmevZ_9vh4QnHDJgsXoEgitDtFV_atOZrVLQNtI,10170
298
298
  junifer/preprocess/warping/_fsl_warper.py,sha256=dH1xd3jTRPREzgdh98Dz_4o2gwdrOgc0h5wbARSSB98,5226
299
299
  junifer/preprocess/warping/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
300
300
  junifer/preprocess/warping/space_warper.py,sha256=mf7SDu574R3TXNt82fqGl_hcEYx7SjXwz2TcmWObHQA,7706
@@ -341,10 +341,10 @@ junifer/utils/tests/test_config.py,sha256=7ltIXuwb_W4Mv_1dxQWyiyM10XgUAfsWKV6D_i
341
341
  junifer/utils/tests/test_fs.py,sha256=WQS7cKlKEZ742CIuiOYYpueeAhY9PqlastfDVpVVtvE,923
342
342
  junifer/utils/tests/test_helpers.py,sha256=k5qqfxK8dFyuewTJyR1Qn6-nFaYNuVr0ysc18bfPjyU,929
343
343
  junifer/utils/tests/test_logging.py,sha256=duO4ou365hxwa_kwihFtKPLaL6LC5XHiyhOijrrngbA,8009
344
- junifer-0.0.6.dev330.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
345
- junifer-0.0.6.dev330.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
346
- junifer-0.0.6.dev330.dist-info/METADATA,sha256=LkxGgT6R7p-H0fZTaFoWi71TBNqAnRpuXVa9w6DUhZ4,8429
347
- junifer-0.0.6.dev330.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
348
- junifer-0.0.6.dev330.dist-info/entry_points.txt,sha256=6O8ru0BP-SP7YMUZiizFNoaZ2HvJpadO2G7nKk4PwjI,48
349
- junifer-0.0.6.dev330.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
350
- junifer-0.0.6.dev330.dist-info/RECORD,,
344
+ junifer-0.0.6.dev335.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
345
+ junifer-0.0.6.dev335.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
346
+ junifer-0.0.6.dev335.dist-info/METADATA,sha256=WeHldE8PQXwyXQvgchca6TTVSjFOCWYuPql8YVCDmwo,8429
347
+ junifer-0.0.6.dev335.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
348
+ junifer-0.0.6.dev335.dist-info/entry_points.txt,sha256=6O8ru0BP-SP7YMUZiizFNoaZ2HvJpadO2G7nKk4PwjI,48
349
+ junifer-0.0.6.dev335.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
350
+ junifer-0.0.6.dev335.dist-info/RECORD,,