Skip to content

Conversation

oesteban
Copy link
Contributor

I refactored the structure, added new interfaces ( PrepareFieldmap, TOPUP, ApplyTOPUP) and corresponding workflows ( fieldmap_correct and topup_correct )

A new preprocess file will contain all workflows regarding preprocessing
of EPI images.
Since I'm to replace this workflow, I rename it with its ``classic''
name. The new pipeline will be based on the latest versions of
```fsl_prepare``` and ```epi_reg``` of FSL.

Additionally, my intention is to provide with an interface for
the new tool ```topup``` and a new workflow for T2-to-B0 registration-based
correction.
Created a new file for adding EPI-related interfaces.
Added base classes for interfaces fsl_prepare_fieldmap, topup and applytopup
Still needed to check outputs
Susceptibility correction with fieldmap
Additionally: now fsl.PrepareFieldmap gives a 4D output, as it
is requested by fugue.
Also, part of the ApplyTOPUP has been refined
Before proceeding to submit the PR.

Close #661
Conflicts:
	nipype/interfaces/fsl/utils.py
	nipype/workflows/dmri/fsl/dti.py
return self._list_outputs()['out_file']
return None

class EddyCorrectInputSpec(FSLCommandInputSpec):
Copy link
Member

Choose a reason for hiding this comment

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

if you have time, could you also add eddy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean, the new tool, right?

Copy link
Member

Choose a reason for hiding this comment

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

yes .. eddy was introduced to deal with the human connectome project data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, it looks similar to applytopup interface, I think I can make it. At least a base version if I found something difficult to implement (e.i. there were 3 parameters in topup that are not interfaced because I don't know exactly how they work).

Copy link
Member

Choose a reason for hiding this comment

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

feel free to ask the FSL mailing list for clarification if their latest documentation here doesn't explain things.

http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/TOPUP/TopupUsersGuide
http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Eddy/UsersGuide

beOn pushed a commit to beOn/nipype that referenced this pull request Sep 20, 2013
In-place run of the standard tool. Ref nipy#662
@satra
Copy link
Member

satra commented Oct 2, 2013

this is looking great - i'll try to run it on some data this week and will merge over the weekend. i'll send PR's to your branch before that.

@beOn
Copy link
Contributor

beOn commented Oct 2, 2013

Cool deal - let me know if it needs anything else!

On Oct 2, 2013, at 8:02 AM, Satrajit Ghosh notifications@github.com wrote:

this is looking great - i'll try to run it on some data this week and will merge over the weekend. i'll send PR's to your branch before that.


Reply to this email directly or view it on GitHub.

* New interface for eddy. NO TESTING HAS BEEN DONE, though
* Added interface.cmdline on documentation comments
Added Eddy to __init__
Fixed minor typo in documentation comments.
@oesteban
Copy link
Contributor Author

oesteban commented Oct 5, 2013

I think most of the requirements are met:

  • Added new FSL-eddy interface
  • Some fixes to TOPUP and associated workflow
  • Added interface.cmdline to documentation

Ready?

This reverts commit 5f5b978.
@satra
Copy link
Member

satra commented Oct 8, 2013

@oesteban - there are several failing tests. please run: make test in the main directory.

@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

Ok, I'm currently running it. I'm sorry I did not know I should check for that.

This would fix one of the failed tests
@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

I started using Travis CI -> https://travis-ci.org/oesteban/nipype

I have a question: on those errors regarding interface.cmdline how should I fix it, keeping the cmdline as you requested? For the rest of them, I'll try to fix them ASAP. Below, an example of the cmdline errors:

FAIL: Doctest: nipype.interfaces.fsl.epi.ApplyTOPUP
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for nipype.interfaces.fsl.epi.ApplyTOPUP
  File "/home/travis/build/oesteban/nipype/nipype/interfaces/fsl/epi.py", line 241, in ApplyTOPUP
----------------------------------------------------------------------
File "/home/travis/build/oesteban/nipype/nipype/interfaces/fsl/epi.py", line 256, in nipype.interfaces.fsl.epi.ApplyTOPUP
Failed example:
    applytopup.cmdline
Expected nothing
Got:
    'applytopup --datain=topup_encoding.txt --imain=epi.nii,epi_rev.nii --inindex=1,2 --topup=my_topup_results --out=/home/travis/build/oesteban/nipype/nipype/testing/data/nipypeatu'

Added skip command that I guess solve the problem
@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

Probably I had to add # doctest: +SKIP after each line in documentation that should not be executed, right?

create_dmri_preprocessing was still calling the epidewarp workflow
with its former name
@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

A TODO task would be to update the workflow that uses fieldmap correction. It should be able to perform fieldmap with the new fsl_prepare interface and reverse encoding with TOPUP.

This reverts commit 8f08e1c.

Conflicts:
	nipype/algorithms/misc.py

This commit should not be here, sorry for that. If necessary,
I will run autopep again on misc.py
@satra
Copy link
Member

satra commented Oct 8, 2013

@oesteban : here is how to do the command line fixes -

https://github.com/nipy/nipype/blob/master/nipype/interfaces/ants/registration.py#L359

you paste the expected command line right after the interface.cmdline

thanks for switching to travis - it's a good way of running some parts of the tests - we will soon have a mechanism to test across versions and platforms.

Now, the tests are correctly implemented
@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

@satra , one last question: what happens with absolute paths (especially in outputs)... I implemented everything, but of course absolute paths don't match...

@satra
Copy link
Member

satra commented Oct 8, 2013

interfaces typically generate things in either the current working directory (1) or in the directory of some input file (2). nodes will want to generate all output in their local directory. if (2) above, we add the following metadata to the inputspec for that input (copyfile=True/False - True copies, False symlinks).

then in gen_filename we will typically generate a name without the absolute path
and in list_outputs we would do os.path.abspath(generated_name)

@oesteban
Copy link
Contributor Author

oesteban commented Oct 8, 2013

I never managed to use the gen_filename facilities... so I usually hard-code them (which I'm aware is not very nice). But still we are in the same problem: if I let the example automatically generate output names, then the test doesn't work... right?. The os.path.abspath(generated_name) in list_outputs breaks the test.

@chrisgorgo chrisgorgo merged commit 6908420 into nipy:master Oct 11, 2013
@oesteban
Copy link
Contributor Author

Thank you all, I saw that I can use three dots (...) to get the abspath computed from an interface :)

@oesteban oesteban deleted the enh/NewPreprocessDMRIWorkflows branch October 11, 2013 16:45
@satra
Copy link
Member

satra commented Oct 11, 2013

actually we really need to move towards more consistent file generation as available in PR #681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants