Closed daducci closed 3 years ago
Instead of a flag, it might be used a parameter in order to decide how to save different coefficients for the case of multi-compartment models.
Something like: save_coeff=average
or save_coeff=all
Do you think the condition if xec.size > 0
should be checked to create the compartment_EC.nii.gz
? The current implementation creates empty files if there is no EC
.
(Same for iso
compartment)
I don't mind having empty files, perhaps this way an analysis pipeline will not be broken, as a file always exist and the script should only check its length (same for the weights file)
When processing a tractogram with COMMIT, which contains let’s say 100 streamlines, we expect 100 coefficients as output. However, as some streamlines can be “pre-filtered” by
trk2dictionary
(e.g. too short), fewer coefficients (let’s say 98) may actually be estimated. To cope with that, at the moment we create a tractogram that matches this “smaller” set of streamlines, using the parametergen_trk
intrk2dictionary
. This way, the coefficients that are saved toxic.txt
withsave_results(save_coeff=True)
match this smaller tractogram (i.e. 98 coefficients for 98 streamlines).However, this approach is not optimal because this breaks the logic, as the user expects one coefficient for each input streamline, so 100 and not 98; also, the creation of this additional tractogram occupies twice the amount of disk space.
This PR modifies COMMIT to save to the file
xic.txt
one coefficient for each input streamline (i.e. 100); the coefficients corresponding to the "pre-filtered" streamlines are set to 0. This also means that the parametergen_trk
oftrk2dictionary
is not necessary anymore (so it's removed).In the case of models where multiple contributions are estimated for each streamline, e.g.
CylinderZeppelinBall
, thenxic
will contain all such coefficients, i.e. multiple values for every streamline.