MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
295 stars 182 forks source link

population_template: Input format #2800

Open Lestropie opened 9 months ago

Lestropie commented 9 months ago

As part of #2678 I will have to do a decent amount of refactoring of population_template.

One thing that came up while this was simmering in my mind is the fundamental nature of the interface. Originally it took an input directory as input, and optionally -mask would provide another input directory containing mask images. Now with multi-contrast registration it can take multiple directories as inputs. This means there's a whole lot of cross-checking to make sure that files with identical names are present across all of these input directories.

This contrasts against the statistical inference commands, where inputs are text files that contain filesystem paths to images. (I say plural "inputs" deliberately, as with -column option one specifies the same form of information as the primary input exploratory variable data)

Would transitioning population_template to a text-file-based input make sense? If so now might be an appropriate time to do it.

There would still be a potential ambiguity in terms of whether the paths within such a text file are absolute paths / relative to the text file / relative to the working directory, similar to what happens with inference command inputs. But conversely it would mean that eg. if someone generates all derivatives for a participant within a participant-specific directory, they would no longer need to construct dummy input directories containing softlinks to the data, they could just construct these text files. Correspondence between input & mask / multiple contrast inputs would be explicit based on the position within the file, rather than having to match file names.

Lestropie commented 9 months ago

Same argument can be made for dwinormalise group.

Lestropie commented 3 months ago

Not strictly requisite, but would possibly make sense to do together: Extensive use of pathlib throughout population_template. Think I may have mentioned this somewhere, but not finding it immediately. This would include removing mrtrix3.path.all_in_dir().