<html>
<body>
Hi again,<br><br>
Thanks for your answer, it was quite useful for me.<br>
Even so, I have further comments:<br><br>
1) The 'Cut' option improves my examination, but it seems not to be
enough. The code I am using to generate the Deformation Field is the
following:<br>
..........<br>
if( argc >= 7 )<br>
{<br><br>
typedef itk::Vector< float, Dimension >
VectorType;<br>
typedef itk::Image< VectorType, Dimension
> DeformationFieldType;<br><br>
DeformationFieldType::Pointer field =
DeformationFieldType::New();<br>
field->SetRegions(
fixedImageReader->GetOutput()->GetBufferedRegion() );<br>
field->SetOrigin( fixedImage->GetOrigin()
);<br>
field->SetSpacing( fixedImage->GetSpacing()
);<br>
field->Allocate();<br><br>
typedef itk::ImageRegionIterator<
DeformationFieldType > FieldIterator;<br>
FieldIterator fi( field,
fixedImageReader->GetOutput()->GetBufferedRegion()
);<br><br>
fi.GoToBegin();<br><br>
TransformType::InputPointType fixedPoint;<br>
TransformType::OutputPointType movingPoint;<br>
DeformationFieldType::IndexType index;<br><br>
VectorType displacement;<br><br>
while( ! fi.IsAtEnd() )<br>
{<br>
index = fi.GetIndex();<br>
field->TransformIndexToPhysicalPoint(
index, fixedPoint );<br>
movingPoint =
transform1->TransformPoint( fixedPoint );<br>
displacement[0] = movingPoint[0] -
fixedPoint[0];<br>
displacement[1] = movingPoint[1] -
fixedPoint[1];<br>
displacement[2] = movingPoint[2] -
fixedPoint[2];<br>
fi.Set( displacement );<br>
++fi;<br>
}<br><br>
typedef itk::ImageFileWriter< DeformationFieldType
> FieldWriterType;<br>
FieldWriterType::Pointer fieldWriter =
FieldWriterType::New();<br>
fieldWriter->SetInput( field );<br>
fieldWriter->SetFileName( argv[6] );<br>
try<br>
{<br>
fieldWriter->Update();<br>
}<br>
catch( itk::ExceptionObject & excp )<br>
{<br>
std::cerr << "Exception thrown
" << std::endl;<br>
std::cerr << excp <<
std::endl;<br>
return EXIT_FAILURE;<br>
}<br>
}<br>
..........<br><br>
But all I get is an aleatory net of arrows, without clear tendency, even
when the real deformation applied does show one, which I have checked
with the SquaredDifferenceImageFilter and the resulting visualization. Is
it reasonable? <br><br>
2) If the Histogram Matching filter compensate the intensities, it seems
to be reason enough for the algorithm to work. What I don´t reach to
understand, is how does the Warping Filter work after the registration
filter. I mean, if it stores the deformation, when applied over the
original moving image, (not the matched one), shouldn´t it generate the
registered image with a registered position but the previous intensities.
Why does also the image intensities change?<br><br>
3) Actually the scale factor I am obliged to use is approximately 1e-30,
since the vector values are enormous, both for the Resampling and Warping
filters. So of course I´m able to see the vectors, but they don´t look
like a field. I´m afraid that I´m doing something wrong, isn´t
it?<br><br>
Thanks a lot.<br>
Regards,<br><br>
Rosario<br><br>
<br>
At 17:50 20/02/2006, Luis Ibanez wrote:<br><br>
<blockquote type=cite class=cite cite="">Hi Rosario,<br><br>
Thanks for the detailed description of your problem.<br><br>
Please find some comments below:<br><br>
1) For visualizing a 3D deformation field, you may want<br>
to keep using ParaView but before adding Glyphs to the<br>
vector field, extract a slice from the field by using<br>
the "Cut" filter.<br><br>
In this way you will be able to move the slice back<br>
and forth, as well as change its orientation, and then<br>
see the vectors on that slice. This will prevent
vectors<br>
from other planes to occlude the ones that you are
trying<br>
to examine.<br><br>
<br><br>
2) The Demons registration method may still work with your<br>
images, as long as you use the Histogram Matching
filter<br>
before passing the images to the Demons registration
filter.<br><br>
The Histogram Matching filter is actually compensating<br>
for the intensity differences between your images.<br><br>
<br><br>
3) It is very likely that the reason why you don't see anything<br>
on the deformation field produced by the Demons filter is
that<br>
the vector are too small. You can easily verify this
assumption<br>
by using the Scale option that ParaView offers in the Glyph
menu<br><br>
This option will be in the "Parameters" tab, on
the "Orient/Scale"<br>
frame, and with the title: "Scale
Factor".<br><br>
Try setting a larger value in this scale factor, and let us
know<br>
if that makes your vectors visible.<br><br>
<br><br>
<br>
Thanks<br><br>
<br><br>
Luis<br><br>
<br><br>
------------------<br>
Rosario Sance wrote:<br>
<blockquote type=cite class=cite cite="">Hi everybody,<br>
I´m dealing with a project of motion correction in 3D DCE-MRI series. Up
to now, I´ve tried several elastic registration algorithms, using MI and
different optimizers, and aplying multirresolution strategies. Since
there are intensity changes in my series along the time, I think that the
most appropriate approach is to use multimodality methods, in spite of I
only work with MRI.<br>
Every suggestion of my previous work will welcomed.<br>
Now, my questions:<br>
1) When I define a BSpline grid and obtain a transform from the
registration process, I achieve the registered image using the
itk::ResampleImageFilter
<<a href="http://www.itk.org/Doxygen/html/itkResampleImageFilter_8h-source.html" eudora="autourl">http://www.itk.org/Doxygen/html/itkResampleImageFilter_8h-source.html</a>>.
But since I´m working with 3D and respiratory motion, I have some
difficulties in visualizing the deformation field and interpreting it. I
have tried with the Glyph option of the Paraview tool. Would you
recommend me another way?<br>
2) I have also tried the code of
Examples/Registration/DeformableRegistration2.cxx and
Examples/Registration/DeformableRegistration5.cxx, so I have checked the
possibilities of the DemonsRegistrationFilter and the
LevelSetMotionRegistrationFilter. In principle it should not work because
the dependence with the voxel intensity and the histogram, but I got
surprised because these algorithms reached a good registration outcomes,
correcting the position of the input images. However:<br>
- The resampled image looks
absolutely fine about the position, but not about the intensities, which
seem to be adapted/very similar to those in the reference image. Actually
I am taking the spacing and origin of the fixed image, but since I´m
applying the output of the warping filter on the moving image, shouldn´t
be kept the intensities and corrected only the position? I can´t
understand how does the warping filter works, in spite I have searched in
the documentation...<br>
- On the other hand, I write
the deformation field as an image of vectors from the output of the
warping filter, and keep it in a .vtk file. But when I try to visualize
it as I did with the deformation fields of the resample filter, I don´t
get to see any field. How does this filter store the vectors field and
could it been visualized? Which are the differences between the use of
both of the filters?<br>
Thanks a lot in advance.<br>
Rosario<br><br>
Rosario Sance Garzón<br>
Dpto. Ingeniería Electrónica<br>
E.T.S.I. Telecomunicación<br>
Avda. Ciudad Universitaria s/n<br>
E-28040 - Madrid (SPAIN)<br>
___________________________________________________<br><br>
------------------------------------------------------------------------<br>
_______________________________________________<br>
Insight-users mailing list<br>
Insight-users@itk.org<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" eudora="autourl">http://www.itk.org/mailman/listinfo/insight-users</a></blockquote><br><br>
</blockquote>
<x-sigsep><p></x-sigsep>
<br><br>
<font face="Arial TUR, Helvetica">Rosario Sance Garzón<br>
Dpto. Ingeniería Electrónica<br>
E.T.S.I. Telecomunicación<br>
Avda. Ciudad Universitaria s/n<br>
E-28040 - Madrid (SPAIN)<br>
</font><font face="Eras Medium ITC">___________________________________________________</font>
</body>
</html>