Skip to content

[ENH][WIP] Fix registration + use mask apply in tractoflow#369

Open
arnaudbore wants to merge 2 commits into
nf-neuro:mainfrom
arnaudbore:move_mask_from_registration_module_to_subworkflow
Open

[ENH][WIP] Fix registration + use mask apply in tractoflow#369
arnaudbore wants to merge 2 commits into
nf-neuro:mainfrom
arnaudbore:move_mask_from_registration_module_to_subworkflow

Conversation

@arnaudbore

Copy link
Copy Markdown
Contributor

Type of improvement

Masking for registration modules is done in registration subworkflow

If submitting a new module or fixing a bug, please use the appropriate template.

  • Documentation
  • Development tools (e.g. linter, formatter, etc.)
  • Development container
  • Global update (please specify)
  • Other (please specify)

Describe your improvement

Write a clear and concise description of what the improvement is.

Describe how to test your improvement

Provide a full step-by-step guide to test your improvement.

Checklist before requesting a review

  • Ensure the syntax is correct (EditorConfig and Prettier must pass)
  • Run the test suites if your changes affect any module
  • Regenerate the Poetry lock file if you have updated the dependencies
  • Ensure the documentation is up-to-date

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gagnonanthony gagnonanthony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great job! I left a few comments. Also, I'm trying to figure out what someone would expect as output when supplying images with their associated masks. I would assume they don't really want the masked registered images, but probably the original images warped using the mask, no? This means we should probably add an antsApplyTransforms at the end to warp the moving original (non-masked) image. This is just an opinion and I'm not a power user of this subworkflow, so feel free to chip in!

Comment thread subworkflows/nf-neuro/registration/main.nf
Comment thread subworkflows/nf-neuro/registration/main.nf
Comment thread subworkflows/nf-neuro/registration/main.nf
Comment thread subworkflows/nf-neuro/tractoflow/main.nf
Comment thread subworkflows/nf-neuro/tractoflow/modules.config

@AlexVCaron AlexVCaron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I missed your message on the merged PR. I was not advocating for prior masking as a replacement to feeding the masks to the registration. As @gdevenyi said, neither one or the other has proven stable really, and both have their use-cases.

I'd rather have both options (including their combination). versaFlow is an example of this. Its registration chain from T1 to DWI needs to configure antsRegistration under all 3 cases to work correctly (and more, but let's not get into that).

@arnaudbore

Copy link
Copy Markdown
Contributor Author

Ok I stop coding until we agree on the strategy here is the link to what @gdevenyi said: #367 (comment).

I think to add an extra layer of masking within or before becomes complicated but maybe I'm getting lazy.

@AlexVCaron

Copy link
Copy Markdown
Contributor

Ok I stop coding until we agree on the strategy here is the link to what @gdevenyi said: #367 (comment).

I think to add an extra layer of masking within or before becomes complicated but maybe I'm getting lazy.

I think the current implementation is okay for now, we can extend the conversation at the SIG on Thursday and decide on the matter.

I'm not against complexity, registration is an unstable and complex workflow. Aside healthy adult human brains, it's non-trivial and requires deep fine-tuning.

I'm happy to put my hand in the fryer on this one and contribute to the implementation, as I've done much of what I ask for in versaFlow.

@arnaudbore arnaudbore changed the title [ENH] Fix registration + use mask apply in tractoflow [ENH][WIP] Fix registration + use mask apply in tractoflow Jun 4, 2026
@arnaudbore arnaudbore added the stale Issue that has not moved to be closed if no further discussions occurs after label assignment label Jun 4, 2026
@gdevenyi

gdevenyi commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

I think the safer thing to do here is to add a "mask extraction" option in each of the individual registration tools so that we only have to pass around the full unmasked images. My registration tool already has this as an option internally (--mask-extract) so its easy for me to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issue that has not moved to be closed if no further discussions occurs after label assignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants