[Insight-users] 2 "Update()" - related problems

Ivan.Bricault at imag.fr Ivan.Bricault at imag.fr
Thu, 15 Jan 2004 22:09:21 +0100


Hi all,

I started using ITK a few weeks ago, and it's a great toolkit ! 
Nevertheless, I had some hard time identifying and solving 2 "update()"-
related problems.
Are you aware of that kind of problems ?
Are there any possibly more elegant solutions for that ?
Thanks !

  Ivan.


--------- (1) ---------------

PROBLEM

Within my GUI, a button executes a itk::ResampleImageFilter on a 3D image with 
a user-defined isotropic spacing value (same spacing for x,y,z).

When the user executes the filter various time with various spacing values, 
the following exception is caught during " resampler->Update(); " : 


     Requested region is (at least partially) outside the largest possible 
region.
     Location: Image::PropagateRequestedRegion()


This happens when (and only when) the new spacing value is superior to the 
spacing value used during the previous resample filter update.



SOLUTION

I connected a writer to the resampler :  " writer->SetInput(resampler-
>GetOutput()); "
In my code, instead of doing
     " resampler->Update(); "
I changed for 
     " writer->Update(); "

Now everything is fine, and no exceptions occur.


------------- (2) --------------------------------------

PROBLEM

I use the following pipeline to smooth a 3D image (with 
itk::CurvatureFlowImageFilter), extract a particular slice and then view it 
with a 2D viewer

      smoother3D->SetInput(reader3D->GetOutput());
      extractSlice->SetInput(smoother3D->GetOutput());
      viewer2D->SetInput(extractSlice->GetOutput());

Then, after executing " smoother3D->Update(); " : 

if the user interactively changes the extracted slice to be viewed and 
generates a " viewer2D->Update(); ",
it takes a long time to see the new smoothed slice, because ITK seems to need 
to compute a new smoother3D->Update() which corresponds to some part of the 3D 
image that was not extracted before, and that has not been smoothed yet 
(despite of the smoother3D->Update() ).

SOLUTION

Again, I connected a writer to the smoother :  " writer->SetInput(smoother3D-
>GetOutput()); "
And in my code, instead of doing
     " smoother3D->Update(); "     (*)
I changed for 
     " writer->Update(); "         (**)

The time needed for executing (**) is longer than for (*). But now the 
smoothing process is computed all at once, and the user can view the various 
smoothed slices without experiencing any delay.






-------------------------------------------------
envoyé via Webmail/IMAG !