-
Notifications
You must be signed in to change notification settings - Fork 533
issues with afni.allineate w/ solution (and possible issue with genfile parameter) #2499
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
Comments
@vanandrew - we are trying to slowly discourage the the afni interfaces (especially because of their complex extensions) have been slowly refined. so something like this should perhaps look like: out_file = traits.Str(
desc='output file from 3dAllineate',
argstr='-prefix %s',
name_source='in_file',
name_template='%s_allineate',
keep_extension=True,
xor=['allcostx']) this should void the need (at least for |
@vanandrew - regarding a PR, if you push a branch to your own repo, github will put a prompt to initiate a pull-request against the master branch or you can initiate it with the pull-request tab (on your fork of nipype, in the appropriate branch). the contributing document has recently been updated to help working through the steps. |
@satra - Ah, I see. Thanks for the info! I'll put my changes properly on a branch. |
@satra - Using name_source/name_template seems to break one of the tests, as
I'll just stick with my original solution for now. |
@vanandrew @satra out_file = File(
name_template='%s_allineated',
desc='output file from 3dAllineate',
argstr='-prefix %s',
name_source='in_file',
xor=['allcostx'])
out_matrix = File(
argstr='-1Dmatrix_save %s',
name_template='%s_allineated.aff12.1D',
name_source='in_file',
keep_extension=False,
desc='Save the transformation matrix for each volume.',
xor=['in_matrix','allcostx']) may be this can help fixing this issue ? |
Summary
Hi all. Just started learning nipype, and it's been pretty great so far. I've only run into issues with the
afni.allineate
interface. I was able to fix it on my own, but I thought I should post an issue here for awareness (plus I'm not sure how to do a pull request...)There are 2 problems I've encountered. The first is that
afni.allineate
consistently fails the hash check when placed in a workflow and always reruns. I think this is because thehash_files
parameter needs to be set toFalse
.Referencing the docs, I think this is an appropriate change:
The second issue is that the prefix (
out_file
) argument does not get generated when used in a workflow. This issue is also referenced here: #2216, but with a temporary workaround.My understanding is that when
genfile
is set toTrue
, the_gen_filename()
method for the interface gets called when the user does not specify a value. Looking at the code, the_gen_filename()
does seems to implemented, but not correctly:So I changed it to this:
Which should define the
out_file
to be in the same location and have the same name as thein_file
, but with the '_allineate' suffix.When I run this, the problem seems to be fixed, as the prefix is now defined:
But downstream nodes don't seem to notice that the
out_file
is actually defined now... (Note: I have a node whose in_file is connected to the out_file of the allineate node)After looking at some of the fsl interfaces (and some trial-and-error), I figured out that the downstream nodes seem to be getting the information for their inputs from the
_list_outputs
method of the upstream node, and ignore_gen_filename
. So when I do this:Everything works! But then the question becomes, what's the point of the
genfile
parameter if I have to define a method that checks if the input is defined anyway?I'm not sure how to do a pull request to this repo, so I've attached my git patch below. (This is on nipype 1.0.1)
allineate.patch.tar.gz
The text was updated successfully, but these errors were encountered: