[Insight-users] ITK-VTK image and problems with includes in visual c++ express 2008

Matthieu Duvinage matthieu.duvinage at gmail.com
Thu Dec 11 09:19:02 EST 2008


Hello everybody,

I'm working on a project in the medical field and I'm using VTK. 
However, the last module I have to create seems to be provided only by 
ITK. In fact, I have to transform a volume in a series of PNG files and 
the ImageSeriesWriter class seems to be devoted to that.

1) I have compiled the library with CMake and then done the build all 
and install process. I put the repertories in includes and librairies in 
visual studio express 2008 but I have a problem. The program says that 
the file I have to import is not in the directory whereas it is but in a 
deeper directory. I have again this problem when I put the deeper 
directory in the include directories with another file. Is it possible 
to enable an option in visual to force it to look in deeper directories ?
2) I would like to use the  normals image (see below) from a VTK class 
to use ImageSeriesWriter. Could you give me an example of how to use 
that ? Because I'm a bit lost with all the classes and the principle of 
pipeline. I have seen that there exist VTKimport or export classes to do 
something in this case but how do I have to do ?

I hope I hear from you soon


Matthieu


vtkImageThreshold *mon_tre = vtkImageThreshold::New();
   mon_tre->SetInput(Vol->GetOutput());
   mon_tre->ThresholdByUpper(1300);
   mon_tre->SetInValue(0);
   mon_tre->SetOutValue(3000);
   //mon_tre->ReplaceOutOff();
   //mon_tre->ReplaceInOn();
   mon_tre->Update();
   vtkContourFilter *contours = vtkContourFilter::New();
   contours->SetInput(mon_tre->GetOutput());
   contours->SetValue(1,3000);

   //marsh cube
     // Iso-surface using marching cubes
   vtkMarchingCubes* iso = vtkMarchingCubes::New();
   iso->SetInput(mon_tre->GetOutput());
   iso->SetValue(1,3000); // Surface #0, iso-value=1
     //Decimation
   vtkDecimatePro* decimate=vtkDecimatePro::New();
   decimate->SetInput(iso->GetOutput());
   decimate->SetTargetReduction(0.9);
   decimate->PreserveTopologyOn();
   decimate->SetMaximumError(0.0002);


   // Smoothing
   vtkSmoothPolyDataFilter* smoother =vtkSmoothPolyDataFilter::New();
   smoother->SetInput(iso->GetOutput());
   smoother->SetNumberOfIterations(200);
   smoother->SetRelaxationFactor(0.05);
   //smoother->FeatureEdgeSmoothingOn();
   //smoother->BoundarySmoothingOn();

   vtkPolyDataNormals *normals=vtkPolyDataNormals::New();
   normals->SetInput(smoother->GetOutput());


More information about the Insight-users mailing list