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

dwi2adc: Change IVIM interface #3044

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

dwi2adc: Change IVIM interface #3044

wants to merge 2 commits into from

Conversation

Lestropie
Copy link
Member

As discussed in #2578.

After trialling the IVIM fit in dwi2adc for a facility user, I had to change the interface out of shear frustration.

Rather than concatenating all parameters in a single 4D output image series, the command now exports one or more 3D images encoding different parameters. Importantly this also means that the compulsory positional argument output of the command is the ADC, as expected from the command name.
@Lestropie Lestropie added this to the 3.1.0 updates milestone Nov 24, 2024
@Lestropie Lestropie self-assigned this Nov 24, 2024
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

logszero_and_adc = bsubinv * dwisub;
}

adc_image.value() = logszero_and_adc[1];

Choose a reason for hiding this comment

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

warning: narrowing conversion from 'Scalar' (aka 'double') to 'value_type' (aka 'float') [bugprone-narrowing-conversions]

 }
                            ^

if (std::isnan(ivim_cutoff)) {
if (szero_image.valid()) {
assign_pos_of(adc_image).to(szero_image);
szero_image.value() = std::exp(logszero_and_adc[0]);

Choose a reason for hiding this comment

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

warning: narrowing conversion from 'double' to 'value_type' (aka 'float') [bugprone-narrowing-conversions]

e);
                                  ^

const double f = C / S0;
if (szero_image.valid()) {
assign_pos_of(adc_image).to(szero_image);
szero_image.value() = S0;
}

Choose a reason for hiding this comment

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

warning: narrowing conversion from 'double' to 'value_type' (aka 'float') [bugprone-narrowing-conversions]

S0;
^

}
assign_pos_of(adc_image).to(ivimfrac_image, ivimdiff_image);
ivimfrac_image.value() = f;
ivimdiff_image.value() = Dstar;

Choose a reason for hiding this comment

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

warning: narrowing conversion from 'double' to 'value_type' (aka 'float') [bugprone-narrowing-conversions]

 f;
 ^

}
assign_pos_of(adc_image).to(ivimfrac_image, ivimdiff_image);
ivimfrac_image.value() = f;
ivimdiff_image.value() = Dstar;

Choose a reason for hiding this comment

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

warning: narrowing conversion from 'double' to 'value_type' (aka 'float') [bugprone-narrowing-conversions]

 f;
                                 ^

Eigen::MatrixXd binv, bsubinv;
std::vector<size_t> idx;
const Header H;
Eigen::VectorXd bvals, dwi, dwisub, logszero_and_adc;

Choose a reason for hiding this comment

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

warning: member 'H' of type 'const Header' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]

 H;
 ^

Comment on lines 201 to 202
if (opt.size())
functor.set_bzero_path(opt[0][0]);

Choose a reason for hiding this comment

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

warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]

Suggested change
if (opt.size())
functor.set_bzero_path(opt[0][0]);
");
())!opt.empty()
Additional context

/usr/include/c++/12/bits/stl_vector.h:1082: method 'vector'::empty() defined here

      empty() const _GLIBCXX_NOEXCEPT
      ^

header.ndim() = 4;
header.size(3) = ivim ? 4 : 2;
auto opt = get_options("szero");
if (opt.size())

Choose a reason for hiding this comment

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

warning: implicit conversion 'size_type' (aka 'unsigned long') -> bool [readability-implicit-bool-conversion]

cpp/cmd/dwi2adc.cpp:201:

- ())
+ () != 0u)

Comment on lines 204 to 205
if (opt.size())
functor.initialise_ivim(opt[0][0], opt[0][1], get_option_value("cutoff", ivim_cutoff_default));

Choose a reason for hiding this comment

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

warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]

Suggested change
if (opt.size())
functor.initialise_ivim(opt[0][0], opt[0][1], get_option_value("cutoff", ivim_cutoff_default));
");
())!opt.empty()
Additional context

/usr/include/c++/12/bits/stl_vector.h:1082: method 'vector'::empty() defined here

      empty() const _GLIBCXX_NOEXCEPT
      ^

if (opt.size())
functor.set_bzero_path(opt[0][0]);
opt = get_options("ivim");
if (opt.size())

Choose a reason for hiding this comment

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

warning: implicit conversion 'size_type' (aka 'unsigned long') -> bool [readability-implicit-bool-conversion]

cpp/cmd/dwi2adc.cpp:204:

- ())
+ () != 0u)

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

Successfully merging this pull request may close these issues.

1 participant