30 #include <itkConnectedThresholdImageFilter.h> 48 itk::SimpleMemberCommand<PickingTool>::Pointer pointAddedCommand = itk::SimpleMemberCommand<PickingTool>::New();
86 Superclass::Activated();
111 Superclass::Deactivated();
165 if (orgImage.IsNotNull())
167 if (orgImage->GetDimension() == 4)
170 timeSelector->SetInput(orgImage);
171 timeSelector->SetTimeNr(timeStep);
172 timeSelector->UpdateLargestPossibleRegion();
173 mitk::Image *timedImage = timeSelector->GetOutput();
177 else if (orgImage->GetDimension() == 3)
185 template <
typename TPixel,
unsigned int VImageDimension>
191 typedef typename InputImageType::IndexType IndexType;
192 typedef itk::ConnectedThresholdImageFilter<InputImageType, InputImageType> RegionGrowingFilterType;
193 typename RegionGrowingFilterType::Pointer regionGrower = RegionGrowingFilterType::New();
200 regionGrower->SetInput(itkImage);
201 regionGrower->AddSeed(seedIndex);
206 regionGrower->SetLower(static_cast<typename InputImageType::PixelType>(1));
207 regionGrower->SetUpper(static_cast<typename InputImageType::PixelType>(255));
211 regionGrower->Update();
213 catch (
const itk::ExceptionObject &)
225 resultLabelSetImage->InitializeByLabeledImage(resultImage);
237 float rgb[3] = {1.0f, 0.0f, 0.0f};
241 float opacity = 1.0f;
Data management class that handles 'was created by' relations.
void SetVisibility(bool visible, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="visible")
Convenience method for setting visibility properties (instances of BoolProperty)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
static vtkRenderWindow * GetRenderWindowByName(const std::string &name)
::mitk::Image InputImageType
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
virtual void Add(DataNode *node, const DataStorage::SetOfObjects *parents=nullptr)=0
Adds a DataNode containing a data object to its internal storage.
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
Image::Pointer ImportItkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, const BaseGeometry *geometry=nullptr, bool update=true)
Imports an itk::Image (with a specific type) as an mitk::Image.Instantiates instance of ITKImageImpor...
MITK_TOOL_MACRO(MITKSEGMENTATION_EXPORT, LiveWireTool2D, "LiveWire tool")
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
static RenderingManager * GetInstance()
virtual unsigned int GetTimeStep() const
Module * GetModule() const
Image class for storing images.
ModuleResource GetResource(const std::string &path) const
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
virtual void Remove(const DataNode *node)=0
Removes node from the DataStorage.
virtual bool Exists(const DataNode *node) const =0
Checks if a node exists in the DataStorage.
#define AccessByItk_2(mitkImage, itkImageTypeFunction, arg1, arg2)
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...