Medical Imaging Interaction Toolkit  2018.4.99-9a29ffc6
Medical Imaging Interaction Toolkit
mitk::DicomSeriesReader Class Reference

#include <mitkDicomSeriesReader.h>

Classes

class  CallbackCommand
 Progress callback for DicomSeriesReader. More...
 
class  GantryTiltInformation
 Gantry tilt analysis result. More...
 
class  ImageBlockDescriptor
 Return type of GetSeries, describes a logical group of files. More...
 
class  SliceGroupingAnalysisResult
 Return type of DicomSeriesReader::AnalyzeFileForITKImageSeriesReaderSpacingAssumption. More...
 

Public Types

enum  ReaderImplementationLevel { ReaderImplementationLevel_Supported, ReaderImplementationLevel_PartlySupported, ReaderImplementationLevel_Implemented, ReaderImplementationLevel_Unsupported }
 Describes how well the reader is tested for a certain file type. More...
 
enum  PixelSpacingInterpretation { PixelSpacingInterpretation_SpacingInPatient, PixelSpacingInterpretation_SpacingAtDetector, PixelSpacingInterpretation_SpacingUnknown }
 How the mitk::Image spacing should be interpreted. More...
 
typedef std::vector< std::string > StringContainer
 Lists of filenames. More...
 
typedef void(* UpdateCallBackMethod) (float)
 Interface for the progress callback. More...
 
typedef std::map< std::string, ImageBlockDescriptorFileNamesGrouping
 

Static Public Member Functions

static std::string GetConfigurationString ()
 Provide combination of preprocessor defines that was active during compilation. More...
 
static bool IsDicom (const std::string &filename)
 Checks if a specific file contains DICOM data. More...
 
static FileNamesGrouping GetSeries (const std::string &dir, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
 see other GetSeries(). More...
 
static StringContainer GetSeries (const std::string &dir, const std::string &series_uid, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
 see other GetSeries(). More...
 
static FileNamesGrouping GetSeries (const StringContainer &files, bool sortTo3DPlust, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
 PREFERRED version of this method - scan and sort DICOM files. More...
 
static FileNamesGrouping GetSeries (const StringContainer &files, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
 See other GetSeries(). More...
 
static DataNode::Pointer LoadDicomSeries (const StringContainer &filenames, bool sort=true, bool load4D=true, bool correctGantryTilt=true, UpdateCallBackMethod callback=nullptr, itk::SmartPointer< Image > preLoadedImageBlock=nullptr)
 
static bool LoadDicomSeries (const StringContainer &filenames, DataNode &node, bool sort=true, bool load4D=true, bool correctGantryTilt=true, UpdateCallBackMethod callback=nullptr, itk::SmartPointer< Image > preLoadedImageBlock=nullptr)
 See LoadDicomSeries! Just a slightly different interface. More...
 
static bool IsPhilips3DDicom (const std::string &filename)
 Checks if a specific file is a Philips3D ultrasound DICOM file. More...
 
static std::string ReaderImplementationLevelToString (const ReaderImplementationLevel &enumValue)
 
static std::string PixelSpacingInterpretationToString (const PixelSpacingInterpretation &enumValue)
 

Protected Types

typedef std::pair< StringContainer, StringContainerTwoStringContainers
 for internal sorting. More...
 
typedef std::map< std::string, std::string > TagToPropertyMapType
 Maps DICOM tags to MITK properties. More...
 
typedef itk::GDCMImageIO DcmIoType
 

Static Protected Member Functions

static SliceGroupingAnalysisResult AnalyzeFileForITKImageSeriesReaderSpacingAssumption (const StringContainer &files, bool groupsOfSimilarImages, const gdcm::Scanner::MappingType &tagValueMappings_)
 Ensure an equal z-spacing for a group of files. More...
 
static std::string ConstCharStarToString (const char *s)
 Safely convert const char* to std::string. More...
 
static bool DICOMStringToSpacing (const std::string &s, ScalarType &spacingX, ScalarType &spacingY)
 Safely convert a string into pixel spacing x and y. More...
 
static Point3D DICOMStringToPoint3D (const std::string &s, bool &successful)
 Convert DICOM string describing a point to Point3D. More...
 
static void DICOMStringToOrientationVectors (const std::string &s, Vector3D &right, Vector3D &up, bool &successful)
 Convert DICOM string describing a point two Vector3D. More...
 
template<typename ImageType >
static ImageType::Pointer InPlaceFixUpTiltedGeometry (ImageType *input, const GantryTiltInformation &tiltInfo)
 
static StringContainer SortSeriesSlices (const StringContainer &unsortedFilenames)
 Sort a set of file names in an order that is meaningful for loading them into an mitk::Image. More...
 
static bool ReadPhilips3DDicom (const std::string &filename, itk::SmartPointer< Image > output_image)
 Read a Philips3D ultrasound DICOM file and put into an mitk::Image. More...
 
static std::string CreateMoreUniqueSeriesIdentifier (gdcm::Scanner::TagToValue &tagValueMap)
 Construct a UID that takes into account sorting criteria from GetSeries(). More...
 
static std::string CreateSeriesIdentifierPart (gdcm::Scanner::TagToValue &tagValueMap, const gdcm::Tag &tag)
 Helper for CreateMoreUniqueSeriesIdentifier. More...
 
static std::string IDifyTagValue (const std::string &value)
 Helper for CreateMoreUniqueSeriesIdentifier. More...
 
static void FixSpacingInformation (Image *image, const ImageBlockDescriptor &imageBlockDescriptor)
 
static void ScanForSliceInformation (const StringContainer &filenames, gdcm::Scanner &scanner)
 Scan for slice image information. More...
 
static void LoadDicom (const StringContainer &filenames, DataNode &node, bool sort, bool check_4d, bool correctTilt, UpdateCallBackMethod callback, itk::SmartPointer< Image > preLoadedImageBlock)
 Performs actual loading of a series and creates an image having the specified pixel type. More...
 
template<typename PixelType >
static itk::SmartPointer< ImageLoadDICOMByITK (const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 Feed files into itk::ImageSeriesReader and retrieve a 3D MITK image. More...
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITK (const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITKScalar (const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITKRGBPixel (const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
template<typename PixelType >
static itk::SmartPointer< ImageLoadDICOMByITK4D (std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITK4D (std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITK4DScalar (std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static itk::SmartPointer< ImageMultiplexLoadDICOMByITK4DRGBPixel (std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
 
static std::list< StringContainerSortIntoBlocksFor3DplusT (const StringContainer &presortedFilenames, const gdcm::Scanner::MappingType &tagValueMappings_, bool sort, bool &canLoadAs4D)
 Sort files into time step blocks of a 3D+t image. More...
 
static bool GdcmSortFunction (const gdcm::DataSet &ds1, const gdcm::DataSet &ds2)
 Defines spatial sorting for sorting by GDCM 2. More...
 
static void CopyMetaDataToImageProperties (StringContainer filenames, const gdcm::Scanner::MappingType &tagValueMappings_, DcmIoType *io, const ImageBlockDescriptor &blockInfo, Image *image)
 Copy information about files and DICOM tags from ITK's MetaDataDictionary and from the list of input files to the PropertyList of mitk::Image. More...
 
static void CopyMetaDataToImageProperties (std::list< StringContainer > imageBlock, const gdcm::Scanner::MappingType &tagValueMappings_, DcmIoType *io, const ImageBlockDescriptor &blockInfo, Image *image)
 
static const TagToPropertyMapTypeGetDICOMTagsToMITKPropertyMap ()
 Map between DICOM tags and MITK properties. More...
 

Detailed Description

Definition at line 346 of file mitkDicomSeriesReader.h.

Member Typedef Documentation

◆ DcmIoType

typedef itk::GDCMImageIO mitk::DicomSeriesReader::DcmIoType
protected

Definition at line 856 of file mitkDicomSeriesReader.h.

◆ FileNamesGrouping

Definition at line 479 of file mitkDicomSeriesReader.h.

◆ StringContainer

typedef std::vector<std::string> mitk::DicomSeriesReader::StringContainer

Lists of filenames.

Definition at line 352 of file mitkDicomSeriesReader.h.

◆ TagToPropertyMapType

typedef std::map<std::string, std::string> mitk::DicomSeriesReader::TagToPropertyMapType
protected

Maps DICOM tags to MITK properties.

Definition at line 750 of file mitkDicomSeriesReader.h.

◆ TwoStringContainers

for internal sorting.

Definition at line 745 of file mitkDicomSeriesReader.h.

◆ UpdateCallBackMethod

typedef void(* mitk::DicomSeriesReader::UpdateCallBackMethod) (float)

Interface for the progress callback.

Definition at line 357 of file mitkDicomSeriesReader.h.

Member Enumeration Documentation

◆ PixelSpacingInterpretation

How the mitk::Image spacing should be interpreted.

Compare DICOM PS 3.3 10.7 (Basic Pixel Spacing Calibration Macro).

Enumerator
PixelSpacingInterpretation_SpacingInPatient 
PixelSpacingInterpretation_SpacingAtDetector 

distances are mm within a patient

PixelSpacingInterpretation_SpacingUnknown 

distances are mm at detector surface

NO spacing information is present, we use (1,1) as default

Definition at line 382 of file mitkDicomSeriesReader.h.

◆ ReaderImplementationLevel

Describes how well the reader is tested for a certain file type.

Applications should not rely on the outcome for images which are reported ReaderImplementationLevel_Implemented or ReaderImplementationLevel_Unsupported.

Errors to load images which are reported as ReaderImplementationLevel_Supported are considered bugs. For ReaderImplementationLevel_PartlySupported please check the appropriate paragraph in Limitations for specific modalities

Enumerator
ReaderImplementationLevel_Supported 
ReaderImplementationLevel_PartlySupported 

loader code and tests are established

ReaderImplementationLevel_Implemented 

loader code and tests are establised for specific parts of a SOP Class

ReaderImplementationLevel_Unsupported 

loader code is implemented but not accompanied by tests

Definition at line 369 of file mitkDicomSeriesReader.h.

Member Function Documentation

◆ AnalyzeFileForITKImageSeriesReaderSpacingAssumption()

DicomSeriesReader::SliceGroupingAnalysisResult mitk::DicomSeriesReader::AnalyzeFileForITKImageSeriesReaderSpacingAssumption ( const StringContainer files,
bool  groupsOfSimilarImages,
const gdcm::Scanner::MappingType &  tagValueMappings_ 
)
staticprotected

Ensure an equal z-spacing for a group of files.

Takes as input a number of images, which are all equally oriented and spatially sorted along their normal direction.

Internally used by GetSeries. Returns two lists: the first one contins slices of equal inter-slice spacing. The second list contains remaining files, which need to be run through AnalyzeFileForITKImageSeriesReaderSpacingAssumption again.

Relevant code that is matched here is in itkImageSeriesReader.txx (ImageSeriesReader<TOutputImage>::GenerateOutputInformation(void)), lines 176 to 245 (as of ITK 3.20)

Definition at line 474 of file mitkDicomSeriesReader.cpp.

References mitk::DicomSeriesReader::SliceGroupingAnalysisResult::AddFilesToUnsortedBlock(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::AddFileToSortedBlock(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::AddFileToUnsortedBlock(), ConstCharStarToString(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::ContainsGantryTilt(), DICOMStringToOrientationVectors(), DICOMStringToPoint3D(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::FlagGantryTilt(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::GetBlockFilenames(), MITK_DEBUG, and mitk::DicomSeriesReader::SliceGroupingAnalysisResult::UndoPrematureGrouping().

Referenced by GetSeries().

◆ ConstCharStarToString()

std::string mitk::DicomSeriesReader::ConstCharStarToString ( const char *  s)
staticprotected

Safely convert const char* to std::string.

Definition at line 383 of file mitkDicomSeriesReader.cpp.

Referenced by AnalyzeFileForITKImageSeriesReaderSpacingAssumption(), GetSeries(), and LoadDicom().

◆ CopyMetaDataToImageProperties() [1/2]

void mitk::DicomSeriesReader::CopyMetaDataToImageProperties ( StringContainer  filenames,
const gdcm::Scanner::MappingType &  tagValueMappings_,
DcmIoType io,
const ImageBlockDescriptor blockInfo,
Image image 
)
staticprotected

Copy information about files and DICOM tags from ITK's MetaDataDictionary and from the list of input files to the PropertyList of mitk::Image.

Definition at line 1353 of file mitkDicomSeriesReader.cpp.

Referenced by LoadDicom().

◆ CopyMetaDataToImageProperties() [2/2]

◆ CreateMoreUniqueSeriesIdentifier()

std::string mitk::DicomSeriesReader::CreateMoreUniqueSeriesIdentifier ( gdcm::Scanner::TagToValue &  tagValueMap)
staticprotected

Construct a UID that takes into account sorting criteria from GetSeries().

Definition at line 1047 of file mitkDicomSeriesReader.cpp.

References CreateSeriesIdentifierPart(), DICOMStringToOrientationVectors(), IDifyTagValue(), and mitkThrow.

Referenced by GetSeries().

◆ CreateSeriesIdentifierPart()

std::string mitk::DicomSeriesReader::CreateSeriesIdentifierPart ( gdcm::Scanner::TagToValue &  tagValueMap,
const gdcm::Tag &  tag 
)
staticprotected

Helper for CreateMoreUniqueSeriesIdentifier.

Definition at line 1030 of file mitkDicomSeriesReader.cpp.

References IDifyTagValue().

Referenced by CreateMoreUniqueSeriesIdentifier().

◆ DICOMStringToOrientationVectors()

void mitk::DicomSeriesReader::DICOMStringToOrientationVectors ( const std::string &  s,
Vector3D right,
Vector3D up,
bool &  successful 
)
staticprotected

Convert DICOM string describing a point two Vector3D.

DICOM tags like ImageOrientationPatient contain two vectors as float numbers separated by backslashes:

42.7131\13.77\0.7\137.76\0.3

Definition at line 433 of file mitkDicomSeriesReader.cpp.

References MITK_ERROR.

Referenced by AnalyzeFileForITKImageSeriesReaderSpacingAssumption(), CreateMoreUniqueSeriesIdentifier(), and LoadDicom().

◆ DICOMStringToPoint3D()

Point3D mitk::DicomSeriesReader::DICOMStringToPoint3D ( const std::string &  s,
bool &  successful 
)
staticprotected

Convert DICOM string describing a point to Point3D.

DICOM tags like ImagePositionPatient contain a position as float numbers separated by backslashes:

42.7131\13.77\0.7

Definition at line 405 of file mitkDicomSeriesReader.cpp.

References MITK_ERROR.

Referenced by AnalyzeFileForITKImageSeriesReaderSpacingAssumption(), and LoadDicom().

◆ DICOMStringToSpacing()

bool mitk::DicomSeriesReader::DICOMStringToSpacing ( const std::string &  s,
ScalarType spacingX,
ScalarType spacingY 
)
staticprotected

Safely convert a string into pixel spacing x and y.

Definition at line 384 of file mitkDicomSeriesReader.cpp.

Referenced by mitk::DicomSeriesReader::ImageBlockDescriptor::PixelSpacingIsUnknown().

◆ FixSpacingInformation()

void mitk::DicomSeriesReader::FixSpacingInformation ( mitk::Image image,
const ImageBlockDescriptor imageBlockDescriptor 
)
staticprotected

◆ GdcmSortFunction()

bool mitk::DicomSeriesReader::GdcmSortFunction ( const gdcm::DataSet &  ds1,
const gdcm::DataSet &  ds2 
)
staticprotected

Defines spatial sorting for sorting by GDCM 2.

Sorts by image position along image normal (distance from world origin). In cases of conflict, acquisition time is used as a secondary sort criterium.

Definition at line 1181 of file mitkDicomSeriesReader.cpp.

References mitk::eps, MITK_DEBUG, and MITK_ERROR.

Referenced by SortSeriesSlices().

◆ GetConfigurationString()

std::string mitk::DicomSeriesReader::GetConfigurationString ( )
static

Provide combination of preprocessor defines that was active during compilation.

Since this class is a combination of several possible implementations, separated only by ifdef's, calling instances might want to know which flags were active at compile time.

Definition at line 1337 of file mitkDicomSeriesReader.cpp.

Referenced by mitkDICOMLocaleTest().

◆ GetDICOMTagsToMITKPropertyMap()

const DicomSeriesReader::TagToPropertyMapType & mitk::DicomSeriesReader::GetDICOMTagsToMITKPropertyMap ( )
staticprotected

Map between DICOM tags and MITK properties.

Uses as a positive list for copying specified DICOM tags (from ITK's ImageIO) to MITK properties. ITK provides MetaDataDictionary entries of form "gggg|eeee" (g = group, e = element), e.g. "0028,0109" (Largest Pixel in Series), which we want to sort as dicom.series.largest_pixel_in_series".

Definition at line 68 of file mitkDicomSeriesReader.cpp.

References LoadDicomSeries(), and mitk::DataNode::New().

Referenced by CopyMetaDataToImageProperties().

◆ GetSeries() [1/4]

DicomSeriesReader::FileNamesGrouping mitk::DicomSeriesReader::GetSeries ( const std::string &  dir,
bool  groupImagesWithGantryTilt,
const StringContainer restrictions = StringContainer() 
)
static

see other GetSeries().

Find all series (and sub-series – see details) in a particular directory.

Definition at line 1021 of file mitkDicomSeriesReader.cpp.

Referenced by GetSeries().

◆ GetSeries() [2/4]

DicomSeriesReader::StringContainer mitk::DicomSeriesReader::GetSeries ( const std::string &  dir,
const std::string &  series_uid,
bool  groupImagesWithGantryTilt,
const StringContainer restrictions = StringContainer() 
)
static

see other GetSeries().

Warning
Untested, could or could not work.

This differs only by having an additional restriction to a single known DICOM series. Internally, it uses the other GetSeries() method.

Definition at line 1124 of file mitkDicomSeriesReader.cpp.

References GetSeries().

◆ GetSeries() [3/4]

DicomSeriesReader::FileNamesGrouping mitk::DicomSeriesReader::GetSeries ( const StringContainer files,
bool  sortTo3DPlust,
bool  groupImagesWithGantryTilt,
const StringContainer restrictions = StringContainer() 
)
static

PREFERRED version of this method - scan and sort DICOM files.

Parse a list of files for images of DICOM series. For each series, an enumeration of the files contained in it is created.

Returns
The resulting maps UID-like keys (based on Series Instance UID and slice properties) to sorted lists of file names.

SeriesInstanceUID will be enhanced to be unique for each set of file names that is later loadable as a single mitk::Image. This implies that Image orientation, slice thickness, pixel spacing, rows, and columns must be the same for each file (i.e. the image slice contained in the file).

If this separation logic requires that a SeriesInstanceUID must be made more specialized, it will follow the same logic as itk::GDCMSeriesFileNames to enhance the UID with more digits and dots.

Optionally, more tags can be used to separate files into different logical series by setting the restrictions parameter.

Warning
Adding restrictions is not yet implemented!

assumption about this method: returns a map of uid-like-key –> list(filename) each entry should contain filenames that have images of same

  • series instance uid (automatically done by GDCMSeriesFileNames
  • 0020,0037 image orientation (patient)
  • 0028,0030 pixel spacing (x,y)
  • 0018,0050 slice thickness

Definition at line 718 of file mitkDicomSeriesReader.cpp.

References AnalyzeFileForITKImageSeriesReaderSpacingAssumption(), ConstCharStarToString(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::ContainsGantryTilt(), CreateMoreUniqueSeriesIdentifier(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::GetBlockFilenames(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetFilenames(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetImageBlockUID(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetModality(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetPixelSpacingType(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetReaderImplementationLevel(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetSOPClassUIDAsString(), mitk::DicomSeriesReader::SliceGroupingAnalysisResult::GetUnsortedFilenames(), mitk::DicomSeriesReader::ImageBlockDescriptor::HasGantryTiltCorrected(), mitk::DicomSeriesReader::ImageBlockDescriptor::HasMultipleTimePoints(), MITK_DEBUG, MITK_ERROR, PixelSpacingInterpretationToString(), ReaderImplementationLevelToString(), and SortSeriesSlices().

◆ GetSeries() [4/4]

DicomSeriesReader::FileNamesGrouping mitk::DicomSeriesReader::GetSeries ( const StringContainer files,
bool  groupImagesWithGantryTilt,
const StringContainer restrictions = StringContainer() 
)
static

◆ IDifyTagValue()

std::string mitk::DicomSeriesReader::IDifyTagValue ( const std::string &  value)
staticprotected

Helper for CreateMoreUniqueSeriesIdentifier.

Definition at line 1101 of file mitkDicomSeriesReader.cpp.

Referenced by CreateMoreUniqueSeriesIdentifier(), and CreateSeriesIdentifierPart().

◆ InPlaceFixUpTiltedGeometry()

template<typename ImageType >
static ImageType::Pointer mitk::DicomSeriesReader::InPlaceFixUpTiltedGeometry ( ImageType input,
const GantryTiltInformation tiltInfo 
)
staticprotected

◆ IsDicom()

bool mitk::DicomSeriesReader::IsDicom ( const std::string &  filename)
static

Checks if a specific file contains DICOM data.

Definition at line 222 of file mitkDicomSeriesReader.cpp.

◆ IsPhilips3DDicom()

bool mitk::DicomSeriesReader::IsPhilips3DDicom ( const std::string &  filename)
static

Checks if a specific file is a Philips3D ultrasound DICOM file.

Definition at line 229 of file mitkDicomSeriesReader.cpp.

Referenced by mitk::BaseDICOMReaderService::DoRead(), and LoadDicom().

◆ LoadDicom()

void mitk::DicomSeriesReader::LoadDicom ( const StringContainer filenames,
DataNode node,
bool  sort,
bool  check_4d,
bool  correctTilt,
UpdateCallBackMethod  callback,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Performs actual loading of a series and creates an image having the specified pixel type.

Definition at line 1495 of file mitkDicomSeriesReader.cpp.

References mitk::PropertyList::ConcatenatePropertyList(), ConstCharStarToString(), CopyMetaDataToImageProperties(), DICOMStringToOrientationVectors(), DICOMStringToPoint3D(), FixSpacingInformation(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetFilenames(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetModality(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetPixelSpacingType(), mitk::DataNode::GetProperty(), mitk::DataNode::GetPropertyList(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetReaderImplementationLevel(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetSeriesInstanceUID(), mitk::DicomSeriesReader::ImageBlockDescriptor::GetSOPClassUIDAsString(), mitk::BaseProperty::GetValueAsString(), mitk::DicomSeriesReader::ImageBlockDescriptor::HasGantryTiltCorrected(), mitk::DicomSeriesReader::ImageBlockDescriptor::HasMultipleTimePoints(), image, mitk::DicomSeriesReader::ImageBlockDescriptor::IsMultiFrameImage(), IsPhilips3DDicom(), mitk::DicomSeriesReader::GantryTiltInformation::IsRegularGantryTilt(), mitk::DicomSeriesReader::GantryTiltInformation::IsSheared(), MITK_DEBUG, MultiplexLoadDICOMByITK(), MultiplexLoadDICOMByITK4D(), mitk::Image::New(), PixelSpacingInterpretationToString(), ReaderImplementationLevelToString(), ReadPhilips3DDicom(), ScanForSliceInformation(), mitk::DataNode::SetData(), mitk::DataNode::SetName(), and SortIntoBlocksFor3DplusT().

Referenced by LoadDicomSeries().

◆ LoadDICOMByITK()

template<typename PixelType >
static itk::SmartPointer<Image> mitk::DicomSeriesReader::LoadDICOMByITK ( const StringContainer ,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Feed files into itk::ImageSeriesReader and retrieve a 3D MITK image.

Parameters
commandcan be used for progress reporting

◆ LoadDICOMByITK4D()

template<typename PixelType >
static itk::SmartPointer<Image> mitk::DicomSeriesReader::LoadDICOMByITK4D ( std::list< StringContainer > &  imageBlocks,
ImageBlockDescriptor  imageBlockDescriptor,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

◆ LoadDicomSeries() [1/2]

static DataNode::Pointer mitk::DicomSeriesReader::LoadDicomSeries ( const StringContainer filenames,
bool  sort = true,
bool  load4D = true,
bool  correctGantryTilt = true,
UpdateCallBackMethod  callback = nullptr,
itk::SmartPointer< Image preLoadedImageBlock = nullptr 
)
static

Loads a DICOM series composed by the file names enumerated in the file names container. If a callback method is supplied, it will be called after every progress update with a progress value in [0,1].

Parameters
filenamesThe filenames to load.
sortWhether files should be sorted spatially (true) or not (false - maybe useful if presorted)
load4DWhether to load the files as 3D+t (if possible)

Referenced by mitk::BaseDICOMReaderService::DoRead(), and GetDICOMTagsToMITKPropertyMap().

◆ LoadDicomSeries() [2/2]

bool mitk::DicomSeriesReader::LoadDicomSeries ( const StringContainer filenames,
DataNode node,
bool  sort = true,
bool  load4D = true,
bool  correctGantryTilt = true,
UpdateCallBackMethod  callback = nullptr,
itk::SmartPointer< Image preLoadedImageBlock = nullptr 
)
static

See LoadDicomSeries! Just a slightly different interface.

If preLoadedImageBlock is provided, the reader will only "fake" loading and create appropriate mitk::Properties.

Definition at line 171 of file mitkDicomSeriesReader.cpp.

References mitk::DataNode::GetData(), LoadDicom(), MITK_DEBUG, MITK_ERROR, and mitk::DataNode::SetData().

◆ MultiplexLoadDICOMByITK()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITK ( const StringContainer ,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

◆ MultiplexLoadDICOMByITK4D()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITK4D ( std::list< StringContainer > &  imageBlocks,
ImageBlockDescriptor  imageBlockDescriptor,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

◆ MultiplexLoadDICOMByITK4DRGBPixel()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITK4DRGBPixel ( std::list< StringContainer > &  imageBlocks,
ImageBlockDescriptor  imageBlockDescriptor,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Definition at line 17 of file mitkDicomSR_LoadDICOMRGBPixel4D.cpp.

References MITK_ERROR.

Referenced by MultiplexLoadDICOMByITK4D().

◆ MultiplexLoadDICOMByITK4DScalar()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITK4DScalar ( std::list< StringContainer > &  imageBlocks,
ImageBlockDescriptor  imageBlockDescriptor,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Definition at line 17 of file mitkDicomSR_LoadDICOMScalar4D.cpp.

References MITK_ERROR.

Referenced by MultiplexLoadDICOMByITK4D().

◆ MultiplexLoadDICOMByITKRGBPixel()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITKRGBPixel ( const StringContainer ,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Definition at line 17 of file mitkDicomSR_LoadDICOMRGBPixel.cpp.

References MITK_ERROR.

Referenced by MultiplexLoadDICOMByITK().

◆ MultiplexLoadDICOMByITKScalar()

Image::Pointer mitk::DicomSeriesReader::MultiplexLoadDICOMByITKScalar ( const StringContainer ,
bool  correctTilt,
const GantryTiltInformation tiltInfo,
DcmIoType::Pointer &  io,
CallbackCommand command,
itk::SmartPointer< Image preLoadedImageBlock 
)
staticprotected

Definition at line 17 of file mitkDicomSR_LoadDICOMScalar.cpp.

References MITK_ERROR.

Referenced by MultiplexLoadDICOMByITK().

◆ PixelSpacingInterpretationToString()

std::string mitk::DicomSeriesReader::PixelSpacingInterpretationToString ( const PixelSpacingInterpretation enumValue)
static

◆ ReaderImplementationLevelToString()

std::string mitk::DicomSeriesReader::ReaderImplementationLevelToString ( const ReaderImplementationLevel enumValue)
static

◆ ReadPhilips3DDicom()

bool mitk::DicomSeriesReader::ReadPhilips3DDicom ( const std::string &  filename,
itk::SmartPointer< Image output_image 
)
staticprotected

Read a Philips3D ultrasound DICOM file and put into an mitk::Image.

Definition at line 252 of file mitkDicomSeriesReader.cpp.

References mitk::CastToMitkImage().

Referenced by LoadDicom().

◆ ScanForSliceInformation()

void mitk::DicomSeriesReader::ScanForSliceInformation ( const StringContainer filenames,
gdcm::Scanner &  scanner 
)
staticprotected

Scan for slice image information.

Definition at line 1665 of file mitkDicomSeriesReader.cpp.

Referenced by LoadDicom().

◆ SortIntoBlocksFor3DplusT()

std::list< DicomSeriesReader::StringContainer > mitk::DicomSeriesReader::SortIntoBlocksFor3DplusT ( const StringContainer presortedFilenames,
const gdcm::Scanner::MappingType &  tagValueMappings_,
bool  sort,
bool &  canLoadAs4D 
)
staticprotected

Sort files into time step blocks of a 3D+t image.

Called by LoadDicom. Expects to be fed a single list of filenames that have been sorted by GetSeries previously (one map entry). This method will check how many timestep can be filled with given files.

Assumption is that the number of time steps is determined by how often the first position in space repeats. I.e. if the first three files in the input parameter all describe the same location in space, we'll construct three lists of files. and sort the remaining files into them.

Definition at line 1703 of file mitkDicomSeriesReader.cpp.

References MITK_DEBUG, MITK_WARN, and SortSeriesSlices().

Referenced by LoadDicom().

◆ SortSeriesSlices()

DicomSeriesReader::StringContainer mitk::DicomSeriesReader::SortSeriesSlices ( const StringContainer unsortedFilenames)
staticprotected

Sort a set of file names in an order that is meaningful for loading them into an mitk::Image.

Warning
This method assumes that input files are similar in basic properties such as slice thicknes, image orientation, pixel spacing, rows, columns. It should always be ok to put the result of a call to GetSeries(..) into this method.

Sorting order is determined by

  1. image position along its normal (distance from world origin)
  2. acquisition time

If P<n> denotes a position and T<n> denotes a time step, this method will order slices from three timesteps like this:

  P1T1 P1T2 P1T3 P2T1 P2T2 P2T3 P3T1 P3T2 P3T3

Definition at line 1143 of file mitkDicomSeriesReader.cpp.

References GdcmSortFunction(), and MITK_WARN.

Referenced by GetSeries(), and SortIntoBlocksFor3DplusT().


The documentation for this class was generated from the following files: