-
Notifications
You must be signed in to change notification settings - Fork 532
ENH: Specify motion parameter source in modelgen #1379
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
Conversation
@jbpoline you might be interested in this |
I was a little hesitant to make it mandatory because that would break existing scripts. As for defaults, it would probably make sense to have |
437e5c1
to
1466199
Compare
Changes Unknown when pulling a0218e6 on effigies:param_source into * on nipy:master*. |
Tests are not passing because of #1571. Sorry about that. |
Changes Unknown when pulling ffc37b7 on effigies:param_source into * on nipy:master*. |
1 similar comment
Changes Unknown when pulling ffc37b7 on effigies:param_source into * on nipy:master*. |
Changes Unknown when pulling b1b6bd2 on effigies:param_source into * on nipy:master*. |
1 similar comment
Changes Unknown when pulling b1b6bd2 on effigies:param_source into * on nipy:master*. |
Just going to re-up this, since it's behavior our scripts depend on. It'd be nice to keep it working without making a conversion script for our data or maintaining a lab-specific nipype patch set. Is this something y'all are interested in including, and if so, what can I do to get it merge-ready? I don't see obvious tests to write, but let me know if you do. |
nipype/algorithms/modelgen.py
Outdated
@@ -187,6 +187,9 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec): | |||
realignment_parameters = InputMultiPath(File(exists=True), | |||
desc="Realignment parameters returned by motion correction algorithm", | |||
copyfile=False) | |||
parameter_source = traits.Enum("SPM", "FSL", "AFNI", "NiPy", "FSFAST", | |||
desc="Source of motion parameters", | |||
mandatory=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mandatory=False
should be removed.
@effigies - we can include this for now (especially as it doesn't make any change to existing workflows), but this will likely be replaced with the new let's make sure this is merged with current master and all the tests pass. |
Changes Unknown when pulling a664bd4 on effigies:param_source into * on nipy:master*. |
1 similar comment
Changes Unknown when pulling a664bd4 on effigies:param_source into * on nipy:master*. |
0e7df59
to
1867b65
Compare
4d28735
to
76e545d
Compare
Updated this with @chrisfilo's Seem reasonable? |
Note that I removed Nipy because I couldn't find clear documentation on their parameters, and depending on |
e3cb55b
to
96f9c9a
Compare
@satra This is the PR I mentioned yesterday. |
@effigies - for this one in particular, i would like to see the Nipy SpaceTimeRealign output handled, since we use it for our analysis. to do that in an SPM-compatible way, the following would need to happen:
|
I could reuse that code in framewise displacement interface.
…On Mar 8, 2017 8:05 AM, "Satrajit Ghosh" ***@***.***> wrote:
@effigies <https://github.com/effigies> - for this one in particular, i
would like to see the Nipy SpaceTimeRealign output handled, since we use it
for our analysis.
to do that in an SPM-compatible way, the following would need to happen:
nipype_params -> matrix representation -> extracting euler angles and
translation parameters
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1379 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOkp9RA_kqsvZtFsZMKMSU4lCAQu48Cks5rjtG9gaJpZM4HlnKa>
.
|
@satra, @chrisfilo see 57740e1. Does this look reasonable? I found a number of different suggestions on how to extract Euler angles, and whether there are multiple equivalent formulations or different starting assumptions for each, I was unable to make an intelligent choice among them. Given that The I think probably the best way to test this is to remove these lines and make sure RapidArt gives the same results (within some tolerance) for nipy motion parameters. |
You can also run realigment with 4D and say mcflirt and compare FD. They should be roughly the same. |
@effigies - the other piece i'm not sure about now is why i wrote this https://github.com/nipy/nipype/blob/master/nipype/algorithms/rapidart.py#L78 |
From AFNI's
Assuming this applies them left-to-right on the CLI, then you have Rz -> Rx -> Ry -> T, which is what you've got. (But shouldn't the Rz be negative because they label the axis S-I, not I-S?) Incidentally, at least in FSL, scale precedes skew. If the scaling matrix I'm having trouble finding a detailed description of parameters and order-of-operations in the SPM manual. |
nipype/utils/misc.py
Outdated
matrix = to_matrix44(params) | ||
params = np.zeros(6) | ||
params[:3] = M[:3, 3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? "M" is undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops. Fixed.
Are you guys waiting on me for anything here, by the way? I'm just not sure what the status of this one is. |
LGTM
…On Mar 30, 2017 3:39 PM, "Chris Markiewicz" ***@***.***> wrote:
Are you guys waiting on me for anything here, by the way? I'm just not
sure what the status of this one is.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1379 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOkp0wHU1rzItqhG5hYaSNfwLNTutgmks5rrATygaJpZM4HlnKa>
.
|
This change adds an optional
parameter_source
input to theSpecifyModel
classes, with the same options as available inArtifactDetect
, though onlyFSFAST
causes any change from default behavior.Per #706 and https://groups.google.com/d/msg/nipy-user/QzmvYr7x9B4/F30k7sET5lQJ, FSFAST motion parameters are in columns 1-6 (zero-indexed).
The default behavior is changed to choosing the first 6 columns of a parameter file, since the assumption appears to be rotation and translation parameters. Though it might be preferable to restore the old default, which is to take as many columns as are found.