Skip to content

Fixed the fieldcoeff issue and also removed the linear transforms that a... #840

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

Merged
merged 1 commit into from
Jun 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions nipype/workflows/fmri/fsl/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ def create_reg_workflow(name='registration'):
mean2anat = pe.Node(fsl.FLIRT(), name='mean2anat')
mean2anat.inputs.dof = 6
register.connect(inputnode, 'mean_image', mean2anat, 'in_file')
register.connect(inputnode, 'anatomical_image', mean2anat, 'reference')
register.connect(stripper, 'out_file', mean2anat, 'reference')

"""
Now use bbr cost function to improve the transform
Expand Down Expand Up @@ -1169,6 +1169,7 @@ def create_reg_workflow(name='registration'):
"""

anat2target_nonlinear = pe.Node(fsl.FNIRT(), name='anat2target_nonlinear')
anat2target_nonlinear.inputs.fieldcoeff_file=True
register.connect(anat2target_affine, 'out_matrix_file',
anat2target_nonlinear, 'affine_file')
anat2target_nonlinear.inputs.warp_resolution = (8, 8, 8)
Expand All @@ -1188,8 +1189,7 @@ def create_reg_workflow(name='registration'):
warpmean = warp2anat.clone(name='warpmean')
register.connect(warp2anat, 'out_file', warpmean, 'in_file')
register.connect(inputnode, 'target_image', warpmean, 'ref_file')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thelxinoe - thanks for these changes - have you checked these against what feat does?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, actually, there are more changes but I didn't want to make them
because maybe they are a little drastic. I have problems using this because
my T1 voxel size is too low <1mm. This is a problem because the apply warp
will suck up all the ram and then crash. In feat they don't do this. They
just combine the affine transformations and then apply them. This means
that it converts to the standard template which in this case is usually
2mm. This is much more reasonable and will run successfully. I don't really
want to say that it's a bug but it's maybe something to be aware of. Hence
I didn't make the changes.

Also, I removed the addition of the affine transformations because they are
already taken in to account in to the warpfield coefficients. Applying them
again causes major deformation of the registration. You can verify this
here:

http://fsl.fmrib.ox.ac.uk/fslcourse/lectures/practicals/reg/

On Fri, May 2, 2014 at 1:16 PM, Satrajit Ghosh notifications@github.comwrote:

In nipype/workflows/fmri/fsl/preprocess.py:

@@ -1188,8 +1189,7 @@ def create_reg_workflow(name='registration'):
warpmean = warp2anat.clone(name='warpmean')
register.connect(warp2anat, 'out_file', warpmean, 'in_file')
register.connect(inputnode, 'target_image', warpmean, 'ref_file')

  • register.connect(anat2target_affine, 'out_matrix_file', warpmean, 'premat')

@thelxinoe https://github.com/thelxinoe - thanks for these changes -
have you checked these against what feat does?


Reply to this email directly or view it on GitHubhttps://github.com//pull/840/files#r12226723
.

register.connect(anat2target_affine, 'out_matrix_file', warpmean, 'premat')
register.connect(anat2target_nonlinear, 'field_file',
register.connect(anat2target_nonlinear, 'fieldcoeff_file',
warpmean, 'field_file')

"""
Expand All @@ -1206,8 +1206,7 @@ def create_reg_workflow(name='registration'):
warpall = warpall2anat.clone(name='warpall')
register.connect(warpall2anat, 'out_file', warpall, 'in_file')
register.connect(inputnode, 'target_image', warpall, 'ref_file')
register.connect(anat2target_affine, 'out_matrix_file', warpall, 'premat')
register.connect(anat2target_nonlinear, 'field_file',
register.connect(anat2target_nonlinear, 'fieldcoeff_file',
warpall, 'field_file')

"""
Expand All @@ -1218,7 +1217,7 @@ def create_reg_workflow(name='registration'):
register.connect(warpall, 'out_file', outputnode, 'transformed_files')
register.connect(mean2anatbbr, 'out_matrix_file',
outputnode, 'func2anat_transform')
register.connect(anat2target_nonlinear, 'field_file',
register.connect(anat2target_nonlinear, 'fieldcoeff_file',
outputnode, 'anat2target_transform')

return register
Expand Down