Skip to content

WIP: Dtitk #2185

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 30 commits into from
Jan 21, 2018
Merged

WIP: Dtitk #2185

merged 30 commits into from
Jan 21, 2018

Conversation

kesshijordan
Copy link
Contributor

Changes proposed in this pull request

Note: make check-before-commit is throwing an error (see below) I am having trouble figuring out. If anyone has suggestions, please let me know.

Thanks!

  • Kesshi

____ ERROR collecting nipype/interfaces/dtitk/tests/test_auto_AffineTask.py ____
nipype/interfaces/dtitk/tests/test_auto_AffineTask.py:3: in
from ..registration import AffineTask
E ValueError: attempted relative import beyond top-level package
____ ERROR collecting

@mgxd
Copy link
Member

mgxd commented Sep 15, 2017

@kesshijordan

  • Your travis build is failing because the doctests are actually being run - however dtitk isn't present in the environment. You can just add # doctest: +SKIP to the line in your doctest that has either node.run() or node.cmdline

  • As for circle, could you try merging with current nipype master?

@kesshijordan
Copy link
Contributor Author

@mgxd I'm not sure how to debug this; if you have any suggestions they are most welcome.

I merged with the current nipype master, but am getting the error, below, in the circleci.

  • echo 'These tests were designed to be run at 4x parallelism.'
    These tests were designed to be run at 4x parallelism.

Are you familiar with the error, below? It's the same one I get when I try make check-before-commit and was having trouble figuring out.

Thanks!
Kesshi

____ ERROR collecting nipype/interfaces/dtitk/tests/test_auto_AffineTask.py ____
nipype/interfaces/dtitk/tests/test_auto_AffineTask.py:3: in
from ..registration import AffineTask
E ValueError: Attempted relative import in non-package

@mgxd
Copy link
Member

mgxd commented Sep 18, 2017

@kesshijordan

regarding travis - you're missing an __init__.py in your dtitk/tests directory.

for circle - did you start working on this branch awhile ago? It seems your circle build is not running on 4x parallelism, you may have to manually change that within your circleci build settings. Perhaps @oesteban can chime in here

@oesteban
Copy link
Contributor

Yes - for circle just go to https://circleci.com/gh/kesshijordan/nipype/edit#parallel-builds and set 4x for your builds.

@codecov-io
Copy link

codecov-io commented Sep 19, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@157d3bd). Click here to learn what that means.
The diff coverage is 76.21%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2185   +/-   ##
=========================================
  Coverage          ?   72.41%           
=========================================
  Files             ?     1210           
  Lines             ?    59762           
  Branches          ?     8595           
=========================================
  Hits              ?    43274           
  Misses            ?    15090           
  Partials          ?     1398
Flag Coverage Δ
#smoketests 72.41% <76.21%> (?)
#unittests 70.01% <76.21%> (?)
Impacted Files Coverage Δ
...rfaces/dtitk/tests/test_auto_TVAdjustOriginTask.py 100% <100%> (ø)
...erfaces/dtitk/tests/test_auto_TVAdjustVoxSpTask.py 100% <100%> (ø)
nipype/interfaces/dtitk/__init__.py 100% <100%> (ø)
...terfaces/dtitk/tests/test_auto_CommandLineDtitk.py 100% <100%> (ø)
...pype/interfaces/tests/test_auto_SimpleInterface.py 100% <100%> (ø)
nipype/interfaces/dtitk/base.py 38.46% <38.46%> (ø)
nipype/interfaces/dtitk/utils.py 60.73% <60.73%> (ø)
nipype/interfaces/dtitk/registration.py 80% <80%> (ø)
...terfaces/dtitk/tests/test_auto_affScalarVolTask.py 85.71% <85.71%> (ø)
...ype/interfaces/dtitk/tests/test_auto_DiffeoTask.py 85.71% <85.71%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 157d3bd...f60c149. Read the comment docs.

@mgxd
Copy link
Member

mgxd commented Sep 19, 2017

@kesshijordan you are close to passing the checks - you'll just have to run make specs and add the updated autotests

@kesshijordan
Copy link
Contributor Author

thank you @mgxd and @oesteban!

Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

A few comments - note that I haven't actually tested the functions though

@@ -0,0 +1,22 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

this file isn't necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two quick questions:

  1. There isn't anything in the directories from .cache on: Is there any reason not to remove everything including .cache? (or is it better to just delete lastfailed?)
  2. I see the comment about lastfailed not being necessary: is that the only comment, or is there somewhere else I should be looking for other comments?

Thanks again, @mgxd!
Kesshi

Copy link
Member

Choose a reason for hiding this comment

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

@kesshijordan

  1. I believe the .cache directory is created by pytest when running nipype's tests, and this file just serves as a reminder when retrying - you can keep this in your local clone, but it doesn't really serve a purpose on the master repo.
  2. Nope, that's it!

Copy link
Member

Choose a reason for hiding this comment

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

@kesshijordan - lastfailed is the only one that's included in the commit. probably got added by mistake. but in general nothing in .cache should be in the commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @satra. I removed the .cache file from git and have pushed the change. @mgxd is there anything else I need to address?

@satra
Copy link
Member

satra commented Oct 3, 2017

@kesshijordan and @mgxd - could this be reviewed/updated soon? i think it's very close.

"""

# from .base import ()
from ..dtitk.registration import (RigidTask, AffineTask, DiffeoTask,
Copy link
Member

Choose a reason for hiding this comment

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

from .registration import ... is a bit cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

ComposeXfmTask, diffeoSymTensor3DVolTask,
affSymTensor3DVolTask, affScalarVolTask,
diffeoScalarVolTask)
from ..dtitk.utils import (TVAdjustOriginTask, TVAdjustVoxSpTask,
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


def _list_outputs(self):
outputs = self.output_spec().get()
outputs['out_file_xfm'] = self.inputs.in_file.replace('.nii.gz',
Copy link
Member

Choose a reason for hiding this comment

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

this may be a good time to use _gen_fname()


def _list_outputs(self):
outputs = self.output_spec().get()
outputs['out_file_xfm'] = self.inputs.in_fixed_tensor.replace(
Copy link
Member

Choose a reason for hiding this comment

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

same as above

if not isdefined(self.inputs.out_file):
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
suffix=self._suffix,
ext='.'+'.'.join(
Copy link
Member

Choose a reason for hiding this comment

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

will this cover .nii files too?

@@ -0,0 +1,22 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

@kesshijordan

  1. I believe the .cache directory is created by pytest when running nipype's tests, and this file just serves as a reminder when retrying - you can keep this in your local clone, but it doesn't really serve a purpose on the master repo.
  2. Nope, that's it!

@satra
Copy link
Member

satra commented Oct 16, 2017

is this still a wip, or is this ready for merge?

@kesshijordan
Copy link
Contributor Author

Still a WIP... I need to test the way I addressed the last few comments to make sure I don't mess anything up naming the outputs.

@satra
Copy link
Member

satra commented Oct 24, 2017

@kesshijordan - any chance we can get this in by the oct 31 deadline? we are going to cut a new release.

@kesshijordan
Copy link
Contributor Author

👍

@satra
Copy link
Member

satra commented Oct 29, 2017

@kesshijordan - a recent PR from @oesteban takes care of the unicode issue. could you please make sure you are merged with current master?

@oesteban
Copy link
Contributor

@satra I think that PR did not affect the 'stream' type of terminal_output.

@kesshijordan, in order to facilitate your debugging, could you set terminal_output = 'file_split' on your interface? That would avoid the problem you are getting (after you merge current master as Satra suggested).

I have opened an issue (link is above) for the UnicodeDecodeError problem.

@kesshijordan
Copy link
Contributor Author

Thanks, @oesteban! I set it when I use the interface (like the example below), and it will run without the UTF-8 error. This doesn't interfere with my debugging, but FYI: if I run it such that the command line would throw and error, the node runs until manually killed with control C. When you kill it and open up the stderr.nipype, the node appears to be running over and over with jumbled letters replacing the filenames.

https://github.com/nipy/nipype/blob/1a7401328baf4aca0f163ca18d3a88b913412eb3/doc/users/saving_workflows.rst

@kesshijordan
Copy link
Contributor Author

kesshijordan commented Oct 30, 2017

Thanks for the pointers, @mgxd. I tried your suggestion for installing and it worked... this is much easier! Regarding question 2: the error occurred because I hadn't set some of the inputs the command line needed; I am using python 3 (though when I first ran this, I think I was using 2.7). I got the rigid registration interface to work and will modify the subsequent interfaces in the same way so they take two niftis and a set of parameters instead of a nifti and a text file containing a nifti (different functions in dti-tk). I'm having trouble getting the generalized file naming to work based on other examples (I keep getting errors that it isn't a "file name" when I manipulate the string) so right now I'm just leaving it at only supporting .nii.gz so I can try to get the rest done before the deadline tomorrow.

@mgxd mgxd modified the milestones: 0.14.0, 0.14.1 Nov 15, 2017
Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

@kesshijordan we can support nii.gz for now, make sure to merge to upstream and remove the extra files and this should be merged soon

stderr.nipype Outdated
@@ -0,0 +1,3 @@
/Users/kesshijordan/repos/dtitk-2.3.3-Darwin-x86_64/scripts/dti_diffeomorphic_reg: line 191: [: 1.0: integer expression expected
Copy link
Member

Choose a reason for hiding this comment

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

you can remove this

stdout.nipype Outdated
@@ -0,0 +1,3 @@
registering /Users/kesshijordan/ref_data/interscan_dys/Trio/IC004-1_dti_b2000_EC_tensorx1000_aff.nii.gz to /Users/kesshijordan/ref_data/interscan_dys/Prisma/IC004-4_dti_b2500_SC_EC_tensorx1000.nii.gz ...
Copy link
Member

Choose a reason for hiding this comment

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

Also remove

@@ -0,0 +1,16 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
Copy link
Member

Choose a reason for hiding this comment

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

remove this too

@effigies
Copy link
Member

Is this something we want in for 1.0? I merged master and updated the auto tests.

@effigies
Copy link
Member

Tests are passing. Is this good to merge? @mgxd @kesshijordan

@mgxd mgxd merged commit 1c174df into nipy:master Jan 21, 2018
@mgxd
Copy link
Member

mgxd commented Jan 21, 2018

we will probably need to re-add the yapf stylized files after make specs - if they are modified I'll add them in a general housekeeping PR before 1.0

@mgxd mgxd modified the milestones: 0.14.1, 1.0 Jan 21, 2018
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.

6 participants