[Insight-users] reading unknown transform - how to itk::TransformFactory<TransformType>::RegisterTransform(); ???

Darren Weber darren.weber.lists at gmail.com
Tue Oct 13 18:01:28 EDT 2009


With regard to reading a transform file, using itk::TransformFileReader,
given the example:
examples/IO/TransformReadWrite.cxx

This example uses the following code to register and read a known
BSplineTransformType, i.e.:

typedef itk::BSplineDeformableTransform<double,3,5> BSplineTransformType;
...
itk::TransformFileReader::Pointer reader;
reader = itk::TransformFileReader::New();
// Some transforms (like the BSpline transform) might not be registered
// with the factory so we add them manually.
itk::TransformFactory<BSplineTransformType>::RegisterTransform();
reader->SetFileName( "Transforms.meta" );
try
    {
    reader->Update();
    }
catch( itk::ExceptionObject & excp )
    {
    std::cerr << "Error while reading the transform file" << std::endl;
    std::cerr << excp << std::endl;
    std::cerr << "[FAILED]" << std::endl;
    return EXIT_FAILURE;
    }


Now let's assume a transform file contains an unknown transform type.

What is the role of the transform factory?  Is it required to read a
transform file?  Is it possible to read a unknown transform file and
register a given transform type with the transform factory after reading the
file?

Suppose the transform file contains a BSplineTransformType, but the
parameters are unknown.  Is it possible to read this transform file?

TIA and take care,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091013/badd4e1d/attachment.htm>


More information about the Insight-users mailing list