27 #include "mitkCorrectorTool2D.xpm"
60 return mitkCorrectorTool2D_xpm;
84 Superclass::Activated();
89 Superclass::Deactivated();
98 m_LastEventSender = positionEvent->
GetSender();
99 m_LastEventSlice = m_LastEventSender->
GetSlice();
104 contour->
Expand(timestep + 1);
141 DataNode *workingNode(m_ToolManager->GetWorkingData(0));
145 Image *image =
dynamic_cast<Image *
>(workingNode->GetData());
147 if (!image || !planeGeometry)
152 if (!image || abstractTransformGeometry)
158 if (m_WorkingSlice.IsNull())
160 MITK_ERROR <<
"Unable to extract slice." << std::endl;
172 singleTimestepContour->AddVertex((*it)->Coordinates);
177 algorithm->SetInput(m_WorkingSlice);
178 algorithm->SetContour(singleTimestepContour);
181 int workingColorId(1);
182 if (labelSetImage.IsNotNull())
184 workingColorId = labelSetImage->GetActiveLabel()->GetValue();
185 algorithm->SetFillColor(workingColorId);
189 algorithm->UpdateLargestPossibleRegion();
191 catch (std::exception &e)
193 MITK_ERROR <<
"Caught exception '" << e.what() <<
"'" << std::endl;
197 resultSlice->Initialize(algorithm->GetOutput());
199 if (labelSetImage.IsNotNull())
208 resultSlice->SetVolume(imAccess.GetData());
209 this->WriteBackSegmentationResult(positionEvent, resultSlice);
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Super class for all position events.
virtual unsigned int GetSlice() const
virtual void SetClosed(bool isClosed, int timestep=0)
Set closed property to given boolean.
BaseRenderer * GetSender() const
virtual void Initialize() override
Initialize all data objects.
VertexIterator End(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
Point3D GetPositionInWorld() const
mitk::ContourElement::VertexIterator VertexIterator
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
void AddVertex(mitk::Point3D &vertex, int timestep=0)
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
static RenderingManager * GetInstance()
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual void Expand(unsigned int timeSteps) override
Expand the timebounds of the TimeGeometry to given number of timesteps.
Module * GetModule() const
Image class for storing images.
virtual unsigned int GetTimeStep() const
void RequestUpdate(vtkRenderWindow *renderWindow)
LabelSetImage class for handling labels and layers in a segmentation session.
VertexIterator Begin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
Describes a two-dimensional, rectangular plane.
#define CONNECT_FUNCTION(a, f)
ModuleResource GetResource(const std::string &path) const
ImageReadAccessor class to get locked read access for a particular image part.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
vtkRenderWindow * GetRenderWindow() const
Access the RenderWindow into which this renderer renders.
Class for nodes of the DataTree.