Skip to content

ENH: SPM NewSegment multi-channel segmentation #3162

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 2 commits into from
Apr 15, 2020

Conversation

jhuguetn
Copy link
Contributor

@jhuguetn jhuguetn commented Feb 4, 2020

Summary

SPM Segment supports including additional images as alternative data channels to help improving the segmentation results of the first/main channel images by providing complementary information (e.g. multimodal images) to the segmentation procedure.
However, this feature is not (yet) supported by nipype NewSegment interface (see nipype.interfaces.spm.preprocess).

This PR proposes a modification to the existing NewSegment interface to support using several data channels for SPM's segmentation procedure.

As suggested in the contribution guide, changes have been successfully tested via pytest with the following results:

 2734 passed, 230 skipped, 7 xfailed, 15 warnings in 183.65s (0:03:03) 

Related issue: #2342 (comment)

List of changes proposed in this PR (pull-request)

  • refactored NewSegmentInputSpec() class to support a list of channels
  • updated docstring-based examples and new T2.nii file added to testing data
  • updated tests (see test_NewSegment_inputs()

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@satra
Copy link
Member

satra commented Feb 4, 2020

@jhuguetn - thank you for this.

we should maintain backwards compatibility for existing scripts/workflows using the current interface. this can be done by making the original inputs mutually exclusive with the new one. (and still supporting the original functionality).

@jhuguetn
Copy link
Contributor Author

jhuguetn commented Feb 4, 2020

Thanks @satra for considering this proposal.

I see two possible alternatives,

  1. support both original and new inputs in a mutually exclusive way as you suggest, however that -in my opinion- makes the code a bit messier/longer than it should originally be.
  2. create a brand new Interface (e.g. MultiChannelNewSegment) with the changes proposed.

What you think?

@satra
Copy link
Member

satra commented Feb 4, 2020

create a brand new Interface (e.g. MultiChannelNewSegment) with the changes proposed.

i would be fine with a new interface here.

@jhuguetn jhuguetn reopened this Feb 5, 2020
@jhuguetn
Copy link
Contributor Author

jhuguetn commented Feb 5, 2020

I've just included new changes to my original PR proposal. Now it creates a brand new Interface called MultiChannelNewSegment which supports defining multiple channels when running SPM Segment procedure.

@codecov
Copy link

codecov bot commented Feb 6, 2020

Codecov Report

Merging #3162 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3162   +/-   ##
=======================================
  Coverage   67.61%   67.61%           
=======================================
  Files         299      299           
  Lines       39494    39494           
  Branches     5219     5219           
=======================================
  Hits        26703    26703           
  Misses      12083    12083           
  Partials      708      708           
Flag Coverage Δ
#smoketests 53.05% <0.00%> (ø) ⬆️
#unittests 64.86% <0.00%> (ø) ⬆️

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 8fe05af...6790df5. Read the comment docs.

@effigies
Copy link
Member

Is this ready to go?

@effigies effigies added this to the 1.5.0 milestone Feb 24, 2020
@jhuguetn
Copy link
Contributor Author

Hi @effigies, it is from my side. Do you plan to include it in the 1.5.0 release?

@effigies
Copy link
Member

Sounds good. Yes, we'll include it in 1.5.0. That's currently stalled as we try to find time to debug failing tutorials...

@effigies effigies merged commit a70ec99 into nipy:master Apr 15, 2020
@jhuguetn
Copy link
Contributor Author

Great, thanks

@jhuguetn jhuguetn deleted the multichannel_seg branch April 16, 2020 08:30
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.

3 participants