Repository navigation
Remove SampleRandom from SumOfPairwiseCorrelationCoefficientsMetric and PCAMetric2 - #1496
Merged
Merged
Conversation
This private member function was unused. It would not even compile, if it was called!
This private member function was unused. It would not even compile, if it was called!
"NumAdditionalSamplesFixed" and "ReducedDimensionIndex" were not used by SumOfPairwiseCorrelationCoefficientsMetric.
"NumAdditionalSamplesFixed" and "ReducedDimensionIndex" were not used by PCAMetric2.
Member
Author
|
@stefanklein @mstaring Can you please have a look before Monday afternoon? Technically, I think it's harmless to remove this unused code (unused for 11 years already), but it still triggers the question: should the code still have been used? I mean: Should the "SampleLastDimensionRandomly" parameter still be implemented for PCAMetric, PCAMetric2, and/or SumOfPairwiseCorrelationCoefficientsMetric? |
Member
|
Hi Niels, I have not looked at the code, but I can confirm that the option "SampleRandom" is not applicable to PCAMetric, PCAMetric2, and/or SumOfPairwiseCorrelationCoefficientsMetric. Mathematically it is just not (straightforwardly) possible.
Kind regards,
Prof. dr. ir. Stefan Klein
Professor of Applied Medical Image Analysis
General Chair of Biomedical Imaging Group Rotterdam (BIGR)
Dept. of Radiology & Nuclear Medicine
***@***.***
+31 10 7043442<tel:+31%2010%207043442>
Van: Niels Dekker ***@***.***>
Verzonden: vrijdag 20 november 2026 15:48
Aan: SuperElastix/elastix ***@***.***>
CC: Stefan Klein ***@***.***>; Mention ***@***.***>
Onderwerp: Re: [SuperElastix/elastix] Remove SampleRandom from SumOfPairwiseCorrelationCoefficientsMetric and PCAMetric2 (PR #1496)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
***@***.***N-Dekker left a comment (SuperElastix/elastix#1496)<#1496 (comment)>
@stefanklein<https://github.com/stefanklein> @mstaring<https://github.com/mstaring> Can you please have a look before Monday afternoon? Technically, I think it's harmless to remove this unused code (unused for 11 years already), but it still triggers the question: should the code still have been used? I mean: Should the "SampleLastDimensionRandomly" parameter still be implemented for PCAMetric, PCAMetric2, and/or SumOfPairwiseCorrelationCoefficientsMetric?
-
Reply to this email directly, view it on GitHub<#1496?email_source=notifications&email_token=AAF2LNJQW53H3YMXL43UR4L52BKS5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBUGI2DSMRTHA3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-7042492386>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAF2LNJ522FJD3B56ZGFRUD52BKS5AVCNFSNUABEKJSXA33TNF2G64TZHM4TCNJYGY4TINB3JFZXG5LFHM3DKMJRHEYDSMZYG6QXMAQ>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AAF2LNLQWPHQR33RUD7IG6T52BKS5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBUGI2DSMRTHA3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AAF2LNLJ5TGPRXU47IUORZL52BKS5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBUGI2DSMRTHA3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
This parameter is only supported by VarianceOverLastDimensionImageMetric. It is not supported by PCAMetric, PCAMetric2, or SumOfPairwiseCorrelationCoefficientsMetric, as confirmed by Stefan Klein.
This parameter is only supported by VarianceOverLastDimensionImageMetric. It is not supported by PCAMetric or SumOfPairwiseCorrelationCoefficientsMetric.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SampleRandom member functions of SumOfPairwiseCorrelationCoefficientsMetric and PCAMetric2 appear very much like
itk::VarianceOverLastDimensionImageMetric::SampleRandom. VarianceOverLastDimensionImageMetric really uses its SampleRandom member function, but SumOfPairwiseCorrelationCoefficientsMetric and PCAMetric2 do not use SampleRandom at all.The unused SampleRandom member functions appear introduced with commit 764490d, Wyke Huizinga (@whuizinga), 24-11-2015, Add: Added PCAMetric, PCAMetric2 and SumOfPairwiseCorrelationCoefficientsMetric to trunkpublic. These are the metrics I used in 'PCA-based groupwise image registration for quantitative MRI', submitted to Medical Image Analysis.
Slightly related: Note that according to the documentation, four metrics support the parameter "SampleLastDimensionRandomly": PCAMetric, PCAMetric2, SumOfPairwiseCorrelationCoefficientsMetric, and VarianceOverLastDimensionImageMetric. However, only VarianceOverLastDimensionImageMetric really retrieves the parameter. VarianceOverLastDimensionImageMetric internally uses SampleRandom to supports "SampleLastDimensionRandomly".