<div dir="ltr"><div dir="auto" style="word-wrap:break-word">Thank you, Matt!<br><br>For the record, here is the piece of code that solved my problem (it creates a transform named "transform" that contains the deformation field contained in “myfield.nrrd"):<br>
<br>// Read the input vector image<br>typedef itk::Image<typename itk::Transform<double, 3, 3>::OutputVectorType, 3> FieldImageType;<br>FieldImageType::Pointer fieldImage;<br>itk::ImageFileReader<FieldImageType>::Pointer fieldReader = itk::ImageFileReader<FieldImageType>::New(); <br>
std::string myFieldFileName = "myfield.nrrd";<br>fieldReader->SetFileName(myFieldFileName);<br>fieldReader->Update();<br>fieldImage = fieldReader->GetOutput();<br><br>// Define a transform from the field<br>
itk::DisplacementFieldTransform<double,3>::Pointer transform = itk::DisplacementFieldTransform<double,3>::New();<br>transform->SetDisplacementField(fieldImage.GetPointer());</div></div>