InsightSoftwareConsortium / ITKTotalVariation

External Module for Total Variation Algorithms, providing wrap for https://github.com/albarji/proxTV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Axes Change

samuelgerber opened this issue · comments

The total variation can flip the image axis depending on the input orientation:

I assume it's because the temporary double output image here:

auto resultImage = DoubleImageType::New();

is not copying all the meta information from the input image.

Thanks @samuelgerber, what do you think about adding a ChangeInformationTypeFilter after casting it here:

outputCastFilter->SetInput(resultImage);

Not sure if it is better there, or just after instantiating the resultImage.

Either that or:
resultImage->CopyInformation( input );

Is there any reason to prefer one or the other?

That sounds better. Did it solve the problem?
If yes, please open a PR with your fix, and I'll merge asap.