16 #include <itkCommand.h> 41 itk::SimpleMemberCommand<LabelSet>::Pointer command = itk::SimpleMemberCommand<LabelSet>::New();
43 m_LabelContainer[otherIt->first]->AddObserver(itk::ModifiedEvent(), command);
50 Superclass::Modified();
111 pixelValue = newLabel->GetValue();
120 newLabel->SetValue(pixelValue);
124 pixelValue = newLabel->GetValue();
135 itk::SimpleMemberCommand<LabelSet>::Pointer command = itk::SimpleMemberCommand<LabelSet>::New();
137 newLabel->AddObserver(itk::ModifiedEvent(), command);
151 newLabel->SetName(name);
152 newLabel->SetColor(color);
179 PixelType nextActivePixelValue = it->first;
183 if (it->first == pixelValue)
185 it->second->RemoveAllObservers();
189 nextActivePixelValue = it->first;
242 for (; _it != _end; ++_it)
243 _it->second->SetLocked(value);
252 for (; _it != _end; ++_it)
254 _it->second->SetVisible(value);
266 m_LookupTable->GetTableValue(static_cast<int>(pixelValue), rgba);
267 rgba[0] = color.GetRed();
268 rgba[1] = color.GetGreen();
269 rgba[2] = color.GetBlue();
270 if (
GetLabel(pixelValue)->GetVisible())
274 m_LookupTable->SetTableValue(static_cast<int>(pixelValue), rgba);
289 return it->second.GetPointer();
294 bool returnValue =
true;
297 MITK_INFO(verbose) <<
"--- LabelSet Equal ---";
303 returnValue = *lhsLUT == *rhsLUT;
306 MITK_INFO(verbose) <<
"Lookup tabels not equal.";
315 MITK_INFO(verbose) <<
"Active label not equal.";
324 MITK_INFO(verbose) <<
"Layer index not equal.";
333 MITK_INFO(verbose) <<
"Number of labels not equal.";
345 returnValue = rhsit->first == lhsit->first;
348 MITK_INFO(verbose) <<
"Label in label container not equal.";
353 returnValue =
mitk::Equal(*(rhsit->second), *(lhsit->second), eps, verbose);
356 MITK_INFO(verbose) <<
"Label in label container not equal.";
Message AllLabelsModifiedEvent
AllLabelsModifiedEvent is emitted whenever a new label has been removed from the LabelSet.
LabelContainerConstIteratorType IteratorConstBegin() const
Returns a const iterator poiting to the begining of the container.
LabelContainerIteratorType IteratorEnd()
Returns a iterator pointing to the end of the container.
static void SetDICOMSegmentProperties(Label *label)
LabelContainerConstIteratorType IteratorConstEnd() const
Returns a const iterator pointing to the end of the container.
void UpdateLookupTable(PixelType pixelValue)
LookupTable::Pointer m_LookupTable
void OnLabelModified()
Recall itk::Object::Modified event from a label and send a ModifyLabelEvent.
void SetAllLabelsLocked(bool)
A data structure describing a label.
unsigned int GetNumberOfLabels() const
LabelContainerType::iterator LabelContainerIteratorType
void AddLabel(mitk::Label *label)
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void SetColor(const mitk::Color &)
PixelType m_ActiveLabelValue
LabelContainerType m_LabelContainer
Message AddLabelEvent
AddLabelEvent is emitted whenever a new label has been added to the LabelSet.
static const PixelType MAX_LABEL_VALUE
The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535...
void SetNextActiveLabel()
const mitk::Color & GetColor() const
LabelContainerType::const_iterator LabelContainerConstIteratorType
bool ExistLabel(PixelType)
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Message ModifyLabelEvent
ModifyLabelEvent is emitted whenever a label has been modified from the LabelSet. ...
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
Message RemoveLabelEvent
RemoveLabelEvent is emitted whenever a new label has been removed from the LabelSet.
void SetActiveLabel(PixelType)
MITKCORE_EXPORT const ScalarType eps
mitk::Label::PixelType PixelType
LabelContainerIteratorType IteratorBegin()
Returns a iterator poiting to the begining of the container.
void SetLayer(unsigned int)
void RenameLabel(PixelType, const std::string &, const Color &)
Message1< PixelType > ActiveLabelEvent
ActiveLabelEvent is emitted whenever a label has been set as active in the LabelSet.
Label * GetLabel(PixelType pixelValue)
void RemoveLabel(PixelType)
void SetLookupTable(LookupTable *lut)
void SetName(const std::string &name)
The LookupTable class mitk wrapper for a vtkLookupTableThis class can be used to color images with a ...
void SetAllLabelsVisible(bool)