[Insight-users] ITK + VTK + 3D TIFFs
Gib Bogle
g.bogle at auckland.ac.nz
Mon Apr 25 18:09:48 EDT 2011
Hi Richard,
I found my mistake! It is a bit subtle, but I should have caught it sooner.
The tiff I'm testing with is supposed to be cropped from a frame from a 3D
image. I used Irfanview to save the single frame, but when I tried to save it
as a tiff the whole 3D image was saved, so instead I saved it as a jpg. I then
cropped a piece out of this and saved it as a tiff. This looks binary, but
actually has pixels with non-zero values less than 255. A trap for young
players. When I ensure that the test image is indeed binary everything works as
expected.
Sorry for the distraction.
Gib
On 25/04/2011 7:49 p.m., Richard Beare wrote:
> Hi,
> ConnectedComponentImageFilter is only the labelling step. Each
> component comes out with a different ID, which you can then use to
> index other measurements.
>
> A filter that does the series of steps needed is
> itkBinaryShapeOpeningImageFilter (available in the review section).
>
> You need to confirm that the connectivity setting matches your
> expectation - do you want diagonal connections to count, or not. This
> is the FullyConnected option.
>
> On Mon, Apr 25, 2011 at 4:40 PM, Gib Bogle<g.bogle at auckland.ac.nz> wrote:
>> Meantime I've been figuring out how to use itkConnectedComponentImageFilter,
>> the idea being to find all the objects then remove those below a threshold
>> size. I'm getting strange results with my small test image.
>>
>> The image is binary, 437x430. Initially (using pixel type unsigned char) I
>> got the error message about too many objects, so I changed the type to
>> unsigned short. The number of found objects is 838. The image is basically
>> white, with black spots, some of which enclose white regions (these are what
>> I want to remove). I'm finding that some of these enclosed "objects" are
>> missed. There are four with more than 100 pixels (excluding the white
>> background), and only two are identified as objects.
>>
>> Do I have wrong expectations of itkConnectedComponentImageFilter?
>>
>> Thanks
>> Gib
>>
>> On 25/04/2011 4:42 p.m., Bill Lorensen wrote:
>>>
>>> You could use one of itk's voting filters:
>>> itkLabelVotingImageFIlter
>>> itkVotingBinaryHoleFillingImageFilter
>>> itkVotingBinaryIterativeHoleFillingImageFilter
>>>
>>>
>>> On Sun, Apr 24, 2011 at 9:28 PM, Gib Bogle<g.bogle at auckland.ac.nz
>>> <mailto:g.bogle at auckland.ac.nz>> wrote:
>>>
>>> I'm not sure if this should be here or on the VTK message list, so I'm
>>> posting it to both lists.
>>>
>>> I'm processing 3D TIFFs with ITK, but I want to use the island removal
>>> capability of VTK, to filter each 2D image in the 3D stack (as far as I
>>> can
>>> see VTK doesn't know about 3D TIFFs). I presume I need to open the 3D
>>> image
>>> in ITK, select a 2D slice, convert it to VTK 2D image format, apply the
>>> island removal filter, convert it back to ITK image format, and write
>>> it
>>> back into the 3D image. It would be very nice if someone has done
>>> something
>>> similar to this and could show me how to do it.
>>>
>>> Thanks
>>> Gib
>>> _____________________________________
>>> Powered by www.kitware.com<http://www.kitware.com>
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
More information about the Insight-users
mailing list