Opening problem

Emmanuelle Bourrat bourrat at merl.com
Tue Apr 18 16:39:22 EDT 2000


Thank you for answering my question about opening.

Now, I've got a new question.

I would like to extract connected components from my binary volume. If I
understand correctly, the vtkImageSeedConnectivity filter finds itself a
point in the volume that has the value InputConnectValue (if the seed
that it's been given isn't correct) and uses it as a seed. And, its
output is a volume with the value OutputConnectedValue for the voxels
that are connected to the seed, the value OutputUnconnectedValue for the
voxels that are not connected but have the value InputConnectValue, 0
anywhere else.

I have a few problems when running this filter.

First, if I set a seed that isn't coorect, then the filter doesn't seem
to find a correct seed, and its output is a black volume. Isn't the
filter supposed to find another one by itself?

Second, I run the filter on a binary volume composed of a white object
made of several parts and a black background. And I set a good seed,
then the output is as follows: the part of the object from which I chose
the seed has the value OutputConnectedValue, and everything else has the
value OutputUnConnectedValue (even the background). Shouldn't the other
parts of the object (that are not connected to the seed) have the
OutputUnconnectedValue. And shouldn't be the rest equal to 0?

Thanks in advance,
Emmanuelle Bourrat.

PS : Here is my code:

vtkImageOpenClose3D *Open = vtkImageOpenClose3D::New();
	Open->SetInput(MyBinaryVolume);
	Open->SetKernelSize(KernelSize, KernelSize, KernelSize);
	Open->SetOpenValue(255.0);
	Open->SetCloseValue(0.0);

vtkImageCast *imageCast = vtkImageCast::New();
	imageCast->SetInput(Open->GetOutput());
	imageCast->SetOutputScalarTypeToUnsignedChar();

vtkImageSeedConnectivity *Connect = vtkImageSeedConnectivity::New();
	Connect->SetDimensionality(3);
	Connect->SetInput(imageCast->GetOutput());
	Connect->SetInputConnectValue(255);
	Connect->SetOutputConnectedValue(255);
	Connect->SetOutputUnconnectedValue(128);
	Connect->AddSeed(153, 100, 53);

vtkStructuredPointsWriter *writer - vtkSutrcutredPointsWriter::New();
         writer->SetInput(Open->GetOutput);
         etc...


Charles Law wrote:
> 
> The OpenClose  /  Dilate Erode was designed to work on labeled volumes:
> tissue1: val 1, tissue2: va2, tissue3: val3, ...  as well as binary
> volumes.  With this in mind, the operation is only performed at the
> boundary of the two tissues.  One tissue is eroded while the other is
> dilated ...
> 
> Charles,.
> 
>
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list