- for (s = shapes_map.begin(); s != shapes_map.end(); s++) {
- shape = s->second;
- if (shape->GetSize() > 150 && shape->GetSize() <= max_size) {
+ unsigned int nlables = label_map->GetNumberOfLabelObjects();
+ for (unsigned int j = 0; j < nlables; j++) {
+ shape = label_map->GetNthLabelObject(j);
+ if (shape->Size() > 150 && shape->Size() <= max_size) {
+#if ITK_VERSION_MAJOR < 4