-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add tractoflow subworkflow #82
base: main
Are you sure you want to change the base?
Conversation
1e37018
to
8c9a0d5
Compare
8c9a0d5
to
eaeca16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting there !! We may need a discussion on teams to follow up with this discussion about params names and apart from a couple of comments everything seems ready.
RECONST_FRF( ch_reconst_frf ) | ||
ch_versions = ch_versions.mix(RECONST_FRF.out.versions.first()) | ||
|
||
/* Run fiber response aeraging over subjects */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Run fiber response aeraging over subjects */ | |
/* Run fiber response averaging over subjects */ |
acquisition biases, align anatomical and diffusion space, compute DTI and fODF metrics and generate whole brain | ||
tractograms. | ||
---------- Configuration ---------- | ||
- nextflow.config : contains an example configuration for the subworkflow. Includes : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Includes :
dwi_fodf_fit_peaks_ventricle_min_md = 0.003 | ||
|
||
//**PFT tracking**// | ||
fodf_fit_pft = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_pft_tracking makes more sense to me. BUT I didn't see anywhere else.
fodf_fit_pft = true | ||
fodf_pft_fit_random_seed = 0 | ||
fodf_pft_fit_algorithm = "prob" | ||
fodf_pft_fit_step_size = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These names are imo too long why not using: pft_tracking_step_size etc... same for local_tracking_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we we could, as much as possible and it still needs to make sense, keep the same var name we had with the original tractoflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, the simpler the parameters' names, the easier the user will understand how to use them. I think those are only for example purposes; when the subworkflow will be included in a pipeline, the nextflow.config
and modules.config
will need to be either copied or rewritten so they can be changed in the pipeline implementation of tractoflow
.
on the preprocessed DWI image and extract relevant metrics. | ||
PFT TRACKING (dipy) | ||
Perform Particle Filtering Tractography (PFT) on the FODF to generate whole brain tractograms. | ||
LOCAL TRACKING (dipy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPU implementation if 100% scilpy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job! 💯 I wrote some comments, but they shouldn't be hard to solve!
ch_dwi, ch_rev_dwi, | ||
ch_sbref, ch_rev_sbref, | ||
ch_topup_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason why you wrote the inputs as a pair rather than a vertical list? With the reverse images, it does make sense, but I think I would make it homogeneous with how we call the other subworkflows.
ch_registration_fa = PREPROC_DWI.out.dwi_resample | ||
.join(PREPROC_DWI.out.bval) | ||
.join(PREPROC_DWI.out.bvec) | ||
.join(PREPROC_DWI.out.b0_mask) | ||
|
||
REGISTRATION_FA( ch_registration_fa ) | ||
ch_versions = ch_versions.mix(REGISTRATION_FA.out.versions.first()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this adds a process that could be avoided. Unless I am missing something, the complete DTI process (lines 137-143) could be placed here, and the resulting FA map could be used for registration. This would avoid computing the FA twice and reduce runtime.
ch_pft_tracking = ANATOMICAL_SEGMENTATION.out.wm_mask | ||
.join(ANATOMICAL_SEGMENTATION.out.gm_mask) | ||
.join(ANATOMICAL_SEGMENTATION.out.csf_mask) | ||
.join(RECONST_FODF.out.fodf) | ||
.join(RECONST_DTIMETRICS.out.fa) | ||
TRACKING_PFTTRACKING( ch_pft_tracking ) | ||
ch_versions = ch_versions.mix(TRACKING_PFTTRACKING.out.versions.first()) | ||
|
||
// | ||
// MODULE: Run TRACKING/LOCALTRACKING | ||
// | ||
ch_local_tracking = ANATOMICAL_SEGMENTATION.out.wm_mask | ||
.join(RECONST_FODF.out.fodf) | ||
.join(RECONST_DTIMETRICS.out.fa) | ||
TRACKING_LOCALTRACKING( ch_local_tracking ) | ||
ch_versions = ch_versions.mix(TRACKING_LOCALTRACKING.out.versions.first()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect to run both tracking methods in a single run? We should use parameters to select which one we want to run.
@@ -0,0 +1,347 @@ | |||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can drop this line.
fodf_fit_pft = true | ||
fodf_pft_fit_random_seed = 0 | ||
fodf_pft_fit_algorithm = "prob" | ||
fodf_pft_fit_step_size = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, the simpler the parameters' names, the easier the user will understand how to use them. I think those are only for example purposes; when the subworkflow will be included in a pipeline, the nextflow.config
and modules.config
will need to be either copied or rewritten so they can be changed in the pipeline implementation of tractoflow
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work Alex! It's crazy to see it all finished. For my part, I don't have many comments, I agree with Arnaud and Anthony about the input nomenclature for FRF. Anthony's comment is relevant to the DTI_metrics module, which could be earlier to avoid calculating fa twice. But that's all, well done again! 🚀 🥇
description: | | ||
(Optional) The input channel containing the brain probability mask for antsBET, | ||
with intensity range 1 (definitely brain) to 0 (definitely background). | ||
Structure: [ val(meta), path(probability_map) ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anatomical segmentation, you can also add a lesion mask as an input to complete the segmentation. It's optional.
Describe your changes
new subworkflow for tractoflow. I will lint and add tests soon
List test packages used by your subworkflow
Checklist before requesting a review
./subworkflows/nf-neuro/<category>/<tool>/main.nf
./subworkflows/nf-neuro/<category>/<tool>/meta.yml
./subworkflows/nf-neuro/<category>/<tool>/tests/main.nf.test
main.nf.test.snap
snapshotsprettier
andeditorconfig-checker
to fix common syntax issuesnf-core subworkflows lint
and fix all errors