-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support array of outDim and outMM #31
Comments
Latest commit has a new feature The help for this feature is:
Therefore, usage would look like this: $ niimath T1 -comply 256 128 64 1.1 2.2 2.3 0.98 1 c2
Comply dim 256*128*64, pixdim 1.1*2.2*2.3, f_high 0.98 linear 1
conform input: min: 0.000000 max: 1588.000000
Rescale: min: 0.000000 max: 514.512024 scale: 0.495615
src % fslhd c2
...
dim1 256
dim2 128
dim3 64
...
pixdim0 1.000000
pixdim1 1.100000
pixdim2 2.200000
pixdim3 2.300000
...
sform_code 1
sto_xyz:1 1.100000 0.000000 0.000000 -134.376007
sto_xyz:2 0.000000 2.200000 0.000000 -110.706009
sto_xyz:3 0.000000 0.000000 2.300000 -86.375999
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Left-to-Right
sform_yorient Posterior-to-Anterior
sform_zorient Inferior-to-Superior A couple of comments:
|
@neurolabusc , this seems to work nicely. My only comment is that the nibabel conform implementation does not rescale the voxel intensity range. Do you think it would be useful to make From the nibabel docs:
|
@hanayik as per your suggestion the intensity scaling (from 0..255) is only applied if the f_high is greater than 0.0. This is useful for many cases, including CT scans where the voxel intensity is calibrated in Hounsfield units. niimath T1 -comply 256 128 64 1.1 2.2 2.3 0.0 1 c2 |
supporting the nibabel conform functionality rather than the limited Freesurfer implementation could have benefits.
Specifically, the ability to supply “outDim” as an array and “outMM” as an array rather than an int and a float.
https://nipy.org/nibabel/reference/nibabel.processing.html#nibabel.processing.conform
This would allow conforming images for any arbitrary dimension specification and voxel sizes that a ML model may expect, rather than the 256x256x256 and 1mm isotropic options currently supported. This would also allow niimath WASM to serve as a more general purpose helper module to prepare images for arbitrary model inference on the "edge" in the browser.
The text was updated successfully, but these errors were encountered: