-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
antsApplyTransforms not able to read transform txt #1681
Comments
It might be a problem of dimensionality, the correct way to do this is to call
This tells ANTs to apply the 3D transform to each 3D volume of the bold image. If you call |
Ah! That is very helpful. I tried running this:
But got a bus error when I ran it. I tried increasing the memory I requested for the interactive node from 10G, to 20G, to 100G, but I am still getting the bus error. How might I fix this problem? |
Bus error is unusual, can you try adding |
This works for me with ANTs 2.3.5:
|
Oh! That made it pretty far. It got to TR 789 out of 1110 and then said "Killed": Using single precision for computations.
|
Ok that is a lot of volumes. I/O changes proposed in #1555 might help, but for now I think you'll have to split the time series with ImageMath and then apply the warps. Then maybe you can re-assemble with ImageMath but if it runs out of memory you might need to use another tool that supports streaming. |
Thanks for the advice! |
Describe the problem
I am trying to use
antsApplyTransforms
to move a functional image in fmriprep's T1w space into fsnative (freesurfer's T1w space), but the output is not being created. With the "verbose" option turned on, I got a message that the transform file cannot be read. The file was created using fMRIPrep v23.1.4. I am thinking maybe the version of ANTs on my cluster (which seems to be from 2020) may be too old to be compatible with the outputs from fMRIPrep. Does that seem likely to be the case? If not, what might the issue be?To Reproduce
I ran this command (which took ~30 seconds):
It returned no output:
And said that it could not read the initial transform:
But the file exists, and is output from fMRIPrep v23.1.4:
Do you know what might cause ANTs to not be able to read in the transformation file? Is it possible that the ANTs version installed on my cluster is too old?
System information (please complete the following information)
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
ANTs version information
Additional information
Here are details on each of the files:
sub-MWMH212_ses-2_task-rest_space-T1w_desc-preproc_bold.nii.gz
:Spacing [2, 2, 2, 0.555]
Origin [65.6448, 63.687, -59.6174, 0]
Direction
-1 0 0 0
0 -1 0 0
0 0 1 0
0 0 0 1
Size : [69, 90, 69, 1110]
Image Dimensions : [69, 90, 69, 1110]
Bounding Box : {[65.6448 63.687 -59.6174 0], [203.645 243.687 78.3826 616.05]}
Voxel Spacing : [2, 2, 2, 0.555]
Intensity Range : [0, 31125.8]
Mean Intensity : 3874.74
Direction Cos Mtx. :
-1 0 0 0
0 -1 0 0
0 0 1 0
0 0 0 1
Voxel->RAS x-form :
Image Metadata:
ITK_FileNotes = xform matrices modified by FixHeaderApplyTransforms (niworkflows v1.8.1).
ITK_original_direction of unsupported type N3itk6MatrixIdLj4ELj4EEE
ITK_original_spacing of unsupported type St6vectorIdSaIdEE
bitpix = 32
cal_max = 31125.8
cal_min = 0
datatype = 16
descrip = xform matrices modified by FixHeaderApplyTransforms (niworkflows v1.8.1).
dim[0] = 4
dim[1] = 69
dim[2] = 90
dim[3] = 69
dim[4] = 1110
dim[5] = 1
dim[6] = 1
dim[7] = 1
dim_info = 0
intent_code = 0
intent_p1 = 0
intent_p2 = 0
intent_p3 = 0
nifti_type = 1
pixdim[0] = 0
pixdim[1] = 2
pixdim[2] = 2
pixdim[3] = 2
pixdim[4] = 0.555
pixdim[5] = 1
pixdim[6] = 1
pixdim[7] = 1
qform_code = 2
qform_code_name = NIFTI_XFORM_ALIGNED_ANAT
qoffset_x = -65.6448
qoffset_y = -63.687
qoffset_z = -59.6174
quatern_b = 0
quatern_c = 0
quatern_d = 0
scl_inter = 0
scl_slope = 1
sform_code = 2
sform_code_name = NIFTI_XFORM_ALIGNED_ANAT
slice_code = 0
slice_duration = 0
slice_end = 0
slice_start = 0
srow_x = 2 0 0 -65.6448
srow_y = 0 2 0 -63.687
srow_z = 0 0 2 -59.6174
toffset = 0
vox_offset = 352
xyzt_units = 10
fs_T1w.nii.gz
(the freesurfer T1w image converted to nifti format):Spacing [0.8, 0.8, 0.8]
Origin [-132.592, 92.2279, 114.454]
Direction
1 -1.16415e-09 5.82077e-10
5.82077e-10 -0 -1
0 -1 0
Size : 320 320 320
Image Dimensions : [320, 320, 320]
Bounding Box : {[-132.592 92.2279 114.454], [123.408 348.228 370.454]}
Voxel Spacing : [0.8, 0.8, 0.8]
Intensity Range : [0, 182]
Mean Intensity : 11.0504
Direction Cos Mtx. :
1 -1.16415e-09 5.82077e-10
5.82077e-10 -0 -1
0 -1 0
Voxel->RAS x-form :
Image Metadata:
ITK_FileNotes = FreeSurfer Aug 4 2022
ITK_original_direction of unsupported type N3itk6MatrixIdLj3ELj3EEE
ITK_original_spacing of unsupported type St6vectorIdSaIdEE
bitpix = 8
cal_max = 0
cal_min = 0
datatype = 2
descrip = FreeSurfer Aug 4 2022
dim[0] = 3
dim[1] = 320
dim[2] = 320
dim[3] = 320
dim[4] = 1
dim[5] = 1
dim[6] = 1
dim[7] = 1
dim_info = 0
intent_code = 0
intent_p1 = 0
intent_p2 = 0
intent_p3 = 0
nifti_type = 1
pixdim[0] = 0
pixdim[1] = 0.8
pixdim[2] = 0.8
pixdim[3] = 0.8
pixdim[4] = 0
pixdim[5] = 1
pixdim[6] = 1
pixdim[7] = 1
qform_code = 1
qform_code_name = NIFTI_XFORM_SCANNER_ANAT
qoffset_x = 132.592
qoffset_y = -92.2279
qoffset_z = 114.454
quatern_b = 2.05795e-10
quatern_c = 0.707107
quatern_d = -0.707107
scl_inter = 0
scl_slope = 0
sform_code = 1
sform_code_name = NIFTI_XFORM_SCANNER_ANAT
slice_code = 0
slice_duration = 0
slice_end = 0
slice_start = 0
srow_x = -0.8 9.31323e-10 -4.65661e-10 132.592
srow_y = -4.65661e-10 0 0.8 -92.2279
srow_z = 0 -0.8 0 114.454
toffset = 0
vox_offset = 352
xyzt_units = 10
sub-MWMH212_ses-2_from-T1w_to-fsnative_mode-image_xfm.txt
:#Insight Transform File V1.0
#Transform 0
Transform: AffineTransform_float_3_3
Parameters: 1 -0.000130966 -0.000102833 0.000130979 1 0.000149429 0.000102816 -0.000149459 1 -0.000366211 0.0224457 -0.0718994
FixedParameters: 0 0 0
The text was updated successfully, but these errors were encountered: