Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkCompressedImageContainer.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 mitkCompressedImageContainer_h
14 #define mitkCompressedImageContainer_h
15 
17 #include <mitkImage.h>
18 #include <array>
19 #include <memory>
20 #include <utility>
21 
22 namespace mitk
23 {
38  {
39  public:
42 
45 
48 
57  void CompressImage(const Image* image);
58 
68  Image::Pointer DecompressImage() const;
69 
70  private:
71  using CompressedSliceData = std::pair<int, char*>;
72  using CompressedTimeStepData = std::vector<CompressedSliceData>;
73  using CompressedImageData = std::vector<CompressedTimeStepData>;
74 
75  void ClearCompressedImageData();
76 
77  CompressedImageData m_CompressedImageData;
78 
79  std::unique_ptr<PixelType> m_PixelType;
80  TimeGeometry::Pointer m_TimeGeometry;
81  std::array<unsigned int, 2> m_SliceDimensions;
82  unsigned int m_Dimension;
83  };
84 }
85 
86 #endif
#define MITKDATATYPESEXT_EXPORT
Stores a compressed copy of a mitk::Image using LZ4 compression.
~CompressedImageContainer()
Destructor. Frees all compressed data buffers.
CompressedImageContainer & operator=(const CompressedImageContainer &)=delete
Image::Pointer DecompressImage() const
Decompress the stored data and return a new Image.
CompressedImageContainer(const CompressedImageContainer &)=delete
void CompressImage(const Image *image)
Compress the given image and store the result internally.
CompressedImageContainer()
Construct an empty container.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Find image slices visible on a given plane.