extract one slice of a volume

Adrian Anner a.anner at medres.ch
Thu Dec 23 09:08:53 EST 1999


hello

I want to execute the Trehsold filter (and display the result) on one slice
of a volume.
I tried the following :

vtkExtractVOI *extractor = vtkExtractVOI::New();
   extractor->SetInput( v16Reader->GetOutput() );
   extractor->SetVOI( 0, x-1, 0, y-1, slice, slice );
   extractor->Update();

vtkImageThreshold *threshold = vtkImageThreshold::New();
   threshold->ThresholdByUpper( maxThresh );
   threshold->SetInValue(0);
   threshold->SetOutValue(255);
   threshold->SetInput( extractor->GetOutput() );
   threshold->Update();

but it crashs at the statement  threshold->Update() : couldn't read at
adress xxxxxx

if I change the order :

vtkImageThreshold *threshold = vtkImageThreshold::New();
   threshold->ThresholdByUpper( maxThresh );
   threshold->SetInValue(0);
   threshold->SetOutValue(255);
   threshold->SetInput( v16Reader->GetOutput() );
   threshold->Update();

vtkExtractVOI *extractor = vtkExtractVOI::New();
   extractor->SetInput( threshold->GetOutput() );
   extractor->SetVOI( 0, x-1, 0, y-1, slice, slice );
   extractor->Update();

it works fine, but I have to execute the threshold filter over all slices.

any idea ?

thanks

Adrian



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list