[vtkusers] vtkImageThreshold -> ThresholdBetween malfunction

Florent.Chandelier at USherbrooke.ca Florent.Chandelier at USherbrooke.ca
Fri Oct 1 10:44:33 EDT 2004


Hi vtk users,

I'm using the [vtkImageThreshold -> ThresholdBetween] to binarise an image.
here is my code :

 vtkBMPReader *imagein=vtkBMPReader::New();
  imagein->SetFilePrefix ("slices"); // name of the files to read
  imagein->SetDataExtent(0, 1024, 0, 1024,0,5);
  imagein->Update();

  vtkImageThreshold *binimg=vtkImageThreshold::New();
  binimg->SetInput( imagein->GetOutput() );
  binimg->ThresholdBetween(TissueLow, TissueHigh); // Tissue** are float 
respec 100 and 220
  binimg->SetReplaceIn(1);
  binimg->SetInValue(250);
  binimg->SetReplaceOut(1);
  binimg->SetOutValue(80);
  binimg->Update();

But the fact is that when I use vtkcontourfilter with a SetValue of 100 
I got a volume in my renderer window .. whereas I binarise my image in 
between 80 and 250 though .... I don't understand this result !!

any idea

-- 
Florent Chandelier - florent.chandelier at usherbrooke.ca
PhD Student at the university of Sherbrooke (QC, Canada)
Bio mechanical research department - http://www.biomec.gme.usherb.ca/

Lab Phone : (001) (819)-821-7000




More information about the vtkusers mailing list