I’m working on trying to extend the antsTransformInfo tool to print the Determinant of a transform if its Linear as part of its summary information.
The existing implementation is very very simple, a copy of an ITK example:
The transform IO seems to not need to know anything about the transform, not the dimension, nor the type, and immediately supports all the ITK transform types, and can print a summary.
I implemented a partial version for linear transforms, and I’ve already had to instantiate 2D and 3D handlers separately, and this doesn’t support unpacking a composite transform at the least, and probably has other corner cases where it will fall over.
Am I going about this the wrong way? Is there a better way? I want this to support reading arbitrary ITK transforms and print the summary object, and if it’s Linear, add the Determinant.
Or, is the better solution to add the Determinant to all Linear transform summaries in ITK?
using ReadCompositeTransformType =
itk::CompositeTransform<ReadScalarType, Dimension>;
auto it = transforms->begin();
if (!strcmp((*it)->GetNameOfClass(), "CompositeTransform"))
{
ReadCompositeTransformType::Pointer compositeRead =
static_cast<ReadCompositeTransformType *>((*it).GetPointer());
compositeRead->Print(std::cout);
}