Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkDICOMSegmentationIO.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDICOMSegmentationIO_h
14 #define mitkDICOMSegmentationIO_h
15 
16 #include <mitkAbstractFileIO.h>
17 #include <mitkLabelSetImage.h>
18 
20 
21 #include <dcmqi/Dicom2ItkConverterBase.h>
22 #include <dcmqi/JSONSegmentationMetaInformationHandler.h>
23 
24 #include <dcmtk/dcmdata/dcitem.h>
25 
26 #include <memory>
27 #include <vector>
28 
29 namespace mitk
30 {
36  {
37  public:
39  typedef itk::Image<unsigned short, 3> itkInputImageType;
40  typedef itk::Image<short, 3> itkInternalImageType;
41 
44 
45  // -------------- AbstractFileReader -------------
46 
48 
51 
52  // -------------- AbstractFileWriter -------------
53 
55  void Write() override;
56 
59 
60  protected:
66  std::vector<itk::SmartPointer<BaseData>> DoRead() override;
67 
68  private:
69  DICOMSegmentationIO *IOClone() const override;
70 
71  // -------------- DICOMSegmentationIO specific functions -------------
72 
86  void BuildMetaInfoHandler(const MultiLabelSegmentation *input,
87  int layer,
88  dcmqi::JSONSegmentationMetaInformationHandler &handler) const;
89  void SetLabelProperties(Label *label, dcmqi::SegmentAttributes *segmentAttribute);
90 
106  MultiLabelSegmentation::Pointer ReadLabelmapSegmentation(
107  dcmqi::Dicom2ItkConverterBase &converter,
108  dcmqi::JSONSegmentationMetaInformationHandler &metaInfo);
109 
123  MultiLabelSegmentation::Pointer ReadBinarySegmentation(
124  dcmqi::Dicom2ItkConverterBase &converter,
125  dcmqi::JSONSegmentationMetaInformationHandler &metaInfo,
126  bool assumeOverlappingSegments);
127  };
128 } // end of namespace mitk
129 
130 #endif
Abstract base class for implementing a combined file reader and writer.
std::vector< itk::SmartPointer< BaseData > > Read() override
Read data and create a list of BaseData objects.
Read and write MultiLabelSegmentation objects as DICOM Segmentation files.
mitk::MultiLabelSegmentation InputType
std::vector< itk::SmartPointer< BaseData > > DoRead() override
Read DICOM segmentation objects from the file system.
void Write() override
Write the MultiLabelSegmentation as a DICOM Segmentation file.
itk::Image< unsigned short, 3 > itkInputImageType
itk::Image< short, 3 > itkInternalImageType
ConfidenceLevel GetWriterConfidenceLevel() const override
Return the confidence level for writing the given data as a DICOM segmentation.
DICOMSegmentationIO()
Default constructor. Registers reader/writer for the DICOM Segmentation MIME type.
ConfidenceLevel GetReaderConfidenceLevel() const override
Return the confidence level for reading the given file as a DICOM segmentation.
A data structure describing a label in a multi-label segmentation.
Definition: mitkLabel.h:101
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
Find image slices visible on a given plane.
ConfidenceLevel
A confidence level describing the reader's or writer's ability to handle the given data or file forma...
Definition: mitkIFileIO.h:57