[Insight-users] GetPixel() in LabelMap images.

Sergio Vera sergio.vera at alma3d.com
Thu Jun 21 12:51:42 EDT 2012


Hello all!

I have a LabelMap Image and I want to remove all labels except the ones
that have a seed.

Sadly,

std::vector<size_t> selectedLabels;
BOOST_FOREACH(const ITKImgInType::IndexType& seed, d_seeds) {
  ITKImgInType::PixelType value = labelMap->GetPixel(seed);
  if (value != 0) {
    selectedLabels.push_back(value);
    d_os << "Label " << value << " has been selected as a valid label.\n";
  } else {
    d_os << "0 found on " << seed << " :( \n";
  }
}

always return a zero value, even if there should be a correct label in that
seed position (I've checked that on the binary image that generated the
LabelMap). The label map has over 1000 LabelObjects

Theoretically LabelImages support the GetPixel() Method (even if it's
slower).

Any ideas on why this may be happening? I'm using itk 3.20.0 on windows.

Thanks in advance

-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120621/0be0d10d/attachment.htm>


More information about the Insight-users mailing list