[ITK] [ITK-users] Help needed to implement 64-bit "label" image in ITK-Snap for global watershed segmentation mode

Dr. Roman Grothausmann grothausmann.roman at mh-hannover.de
Tue Mar 10 10:14:58 EDT 2015


Dear mailing list members,


To ease further development and possible help, my extensions to ITK-Snap 
(Click'n'Join and a global dynamic watershed segmentation mode) are now 
available on github: https://github.com/romangrothausmann/itksnap.git

The branch rel_3.0+gdWS contains the changes needed for ITK-Snap v3.0, 
rel_3.2+gdWS for ITK-Snap v3.2 and master+gdWS for the newest development. For 
this branch there is also a PR (https://github.com/pyushkevich/itksnap/pull/1) 
with a short description and two screen shots, a documentation (article in the 
MIDAS journal) is on the way.

One point on the ToDo list I would need help on is the realization of the 
join-srouce-image being 64-bit (itk::IdentifierType) and possibly coloured with 
itk::ScalarToRGBPixelFunctor. Other things I tried are those reported before/below.
So if someone has any idea how to realize this or would like to take part in 
further development, please let me know.

Thanks for any help or hints.
Roman


On 01/12/14 13:09, Dr. Roman Grothausmann wrote:
> Dear mailing list members,
>
>
> How can I modify the ColorLabelTableDisplayMappingPolicy to accept also images
> containing labels of long unsigned int, i.e. the output of the
> itkWatershedImageFilter?
> It seems that this image type only causes problems for:
> m_RGBAFilter[i]->SetInput(wrapper->GetSlice(i));
> i.e. m_RGBAFilter can only handle short but the slice from the output of a
> itkWatershedImageFilter is of type long.
> I tried to incorporate a CastImageFilter (see below, as the loss of precision
> does not matter for the colouring), but that cannot be updated because the input
> region size is [0,0] at that position of the pipeline:
>
>
>      typedef itk::Image<typename TWrapperTraits::ComponentType, 2> JsrcImageType;
>      typedef itk::Image<LabelType, 2> LabelInputSliceType;
>      typedef itk::CastImageFilter<JsrcImageType, LabelInputSliceType> CIFType;
>      typename CIFType::Pointer cif;
>      cif = CIFType::New();
>      wrapper->GetSlice(i)->Print(std::cerr);
>      cif->SetInput(dynamic_cast<JsrcImageType *>(wrapper->GetSlice(i)));
>      //cif->InPlaceOff();
>      cif->Print(std::cerr);
>      std::cerr << "cif->Update" << std::endl;
>      //cif->UpdateLargestPossibleRegion();
>      cif->Update(); ////crashes as input region size is [0,0]
>      cif->GetOutput()->Print(std::cerr);
>      m_RGBAFilter[i]->SetInput(cif->GetOutput());
>
>
> I wonder if there is a better place to do the casting but e.g.
> Logic/Slicing/IRISSlicer.txx didn't seem more promising to me.
>
> Or how could I create a new ColorLabelTableDisplayMappingPolicy2 that would
> handle long?
> It seems that the typedef itk::Image<LabelType, 2> InputSliceType; in
> DisplayMappingPolicy.h is not used, i.e. changing it to use long for labels has
> no effect.
>
> Setting the Label type globally to long in SNAPCommon.h:
> typedef itk::IdentifierType LabelType;
> confuses Qt.
>
> Any help or hints how I can handle this type mismatch are very welcome
> Thanks,
> Roman
>

-- 
Dr. Roman Grothausmann

Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis

Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover

Tel. +49 511 532-9574
_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list