-
Notifications
You must be signed in to change notification settings - Fork 153
Support for fixed-length vectors in SetInput functions of two-steps spectral filters #688
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
Support for fixed-length vectors in SetInput functions of two-steps spectral filters #688
Conversation
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.
It's probably working (I'll check the wrappings by rebasing on master) but I have some questions I'd like to discuss before mergin.
@@ -83,16 +85,29 @@ class ITK_TEMPLATE_EXPORT SimplexSpectralProjectionsDecompositionImageFilter | |||
|
|||
/** Set/Get the input material-decomposed stack of projections (only used for initialization) */ | |||
void | |||
SetInputDecomposedProjections(const DecomposedProjectionsType * DecomposedProjections); | |||
SetInputDecomposedProjections( |
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.
Doesn't it work if you keep the original
void SetInputDecomposedProjections(const DecomposedProjectionsType * DecomposedProjections);
separate for clarity?
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.
It should. I'll change it.
void | ||
SetInputFixedVectorLengthDecomposedProjections( | ||
const itk::Image<itk::Vector<DecomposedProjectionsDataType, VNumberOfMaterials>, | ||
DecomposedProjectionsType::ImageDimension> * DecomposedProjections); |
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 it accessible from the wrapping? I'll check.
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.
It does not have to be: SetInputFixedVectorLengthDecomposedProjections is supposed to be accessed only by SetInputDecomposedProjections, once it has determined which vector length to use. The wrappings should only expose SetInputDecomposedProjections
{ | ||
this->SetInputFixedVectorLengthDecomposedProjections<5>(ptr5); | ||
} | ||
} |
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.
Maybe a warning if we don't do anything?
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.
Done
ef525c4
to
8a759ea
Compare
Separate SetInputDecomposedProjections and SetInputMeasuredProjections into two parts, based on their input type (either itk::VectorImage, the default input type, or itk::Image<itk::Vector<>>, the newly supported type) as requested in RTKConsortium#688 (comment) Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
Separate SetInputDecomposedProjections and SetInputMeasuredProjections into two parts, based on their input type (either itk::VectorImage, the default input type, or itk::Image<itk::Vector<>>, the newly supported type) as requested in RTKConsortium#688 (comment) Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
8af69d8
to
47d6551
Compare
One-step and two-steps spectral filters currently use different image types internally. To increase their interoperability, they should also accept in input the type of image they don't use internally. This commit modifies SetInputDecomposedProjections and SetInputMeasuredProjections in rtkSpectralForwardModelImageFilter so that they accept itk::Image<itk::Vector> images (with a limited number of possible vector lengths). It also adds a test case in rtkdecomposespectralprojectionstest to test the modified SetInput functions
Modified the SetInput functions in rtkSimplexSpectralProjectionsDecompositionImageFilter, as was done in commit fc16320 for rtkSpectralForwardModelImageFilter. Updated test case 3 in rtkDecomposeSpectralProjectionsTest to test those new functions
Separate SetInputDecomposedProjections and SetInputMeasuredProjections into two parts, based on their input type (either itk::VectorImage, the default input type, or itk::Image<itk::Vector<>>, the newly supported type) as requested in RTKConsortium#688 (comment) Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
47d6551
to
28c3f3c
Compare
Sorry for taking my time to check the PR. The two-step spectral example does not work anymore with the generated python package which is not what I expected. Do you know what could cause this backward incompatibility? The error message is:
|
The warning is supposed to be issued once the input has been dynamic_cast to all possible supported types, and none of the dynamic_cast has succeeded. I'll look into this |
… supported type Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
… supported type Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
… supported type Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in #688 (comment)
… supported type Add a warning when SetInputDecomposedProjections or SetInputMeasuredProjections fails to cast the input to one of the supported types, as requested in RTKConsortium#688 (comment)
Support for fixed-length vectors in SetInputMeasuredProjections and SetInputDecomposedProjections functions of Simplex and Forward spectral filters, with a limited number of materials and bins
Adds a test case in rtkDecomposeSpectralProjectionsTest to test this feature