Skip to content
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

SIFT2: Changes to output streamline weights units #2922

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Lestropie
Copy link
Member

Closes #2138.

I've for years questioned myself about exactly how this confound should be treated. But in retrospect it's remained unaddressed for too long, and I regularly find myself having to re-explain what factors to apply when, what is automatically applied vs. what isn't, what the default should be, and what the interface should look like.

(I like having the capability to account for differences in response function magnitudes after the fact rather than require common response functions, but in retrospect it just confuses people).

I think I've landed on the right long-term solution. This does result in a difference in command output compared to 3.0.x, but the prior behaviour can also be achieved if desired. Rather than having the interface relate to "has been scaled by X / has not been scaled by X", I think the right approach is to focus on the units in which those streamline weights are provided. That is then easily reportable as metadata in the file header. The new tests hopefully prove the corresponding interpretations.

- Rather than being approximately centred around unity, streamline weights will now be written appropriately pre-multiplied such that they have units mm^2.
- These units can be modified both at the command-line and in the MRtrix configuration file.
- Update tcksift2 reference to OHBM Aperture article.
@Lestropie Lestropie added this to the 3.1.0 updates milestone Jun 11, 2024
@Lestropie Lestropie requested a review from a team June 11, 2024 23:22
@Lestropie Lestropie self-assigned this Jun 11, 2024
@Lestropie
Copy link
Member Author

From #2138:

  • Update online documentation page dedicated to SIFT, adding information about SIFT2, link to the Aperture manuscript, and explaining the circumstances in which one might do it one way vs another

@Lestropie Lestropie marked this pull request as draft June 11, 2024 23:23
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions


ARGUMENTS
+ Argument ("in_tracks", "the input track file").type_tracks_in()
+ Argument ("in_fod", "input image containing the spherical harmonics of the fibre orientation distributions").type_image_in()
+ Argument ("out_weights", "output text file containing the weighting factor for each streamline").type_file_out();

OPTIONS
+ Option ("units", "specify the physical units for the output streamline weights (see Description)")
+ Argument ("choice").type_choice(SIFT2::units_choices)

Choose a reason for hiding this comment

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

warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]

     + Argument ("choice").type_choice(SIFT2::units_choices)
                                       ^

@@ -88,7 +89,7 @@ class TckFactor : public SIFT::Model<Fixel> {

void report_entropy() const;

void output_factors(const std::string &) const;
void output_factors(const std::string &, const units_t) const;

Choose a reason for hiding this comment

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

warning: parameter 2 is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]

Suggested change
void output_factors(const std::string &, const units_t) const;
void output_factors(const std::string &, units_t) const;


namespace MR::DWI::Tractography::SIFT2 {

extern const char* const units_choices[] = { "NOS", "none", "AFD/mm", "AFD.mm-1", "AFD.mm^-1", "mm2", "mm^2", nullptr };

Choose a reason for hiding this comment

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

warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]

extern const char* const units_choices[] = { "NOS", "none", "AFD/mm", "AFD.mm-1", "AFD.mm^-1", "mm2", "mm^2", nullptr };
             ^


namespace MR::DWI::Tractography::SIFT2 {

extern const char* const units_choices[];

Choose a reason for hiding this comment

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

warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]

extern const char* const units_choices[];
             ^

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

Successfully merging this pull request may close these issues.

1 participant