Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDICOMITKSeriesGDCMReader.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 //#define MBILOG_ENABLE_DEBUG
18 #define ENABLE_TIMING
19 
20 #include <itkTimeProbesCollectorBase.h>
21 #include <gdcmUIDs.h>
27 
28 itk::MutexLock::Pointer mitk::DICOMITKSeriesGDCMReader::s_LocaleMutex = itk::MutexLock::New();
29 
30 
31 mitk::DICOMITKSeriesGDCMReader::DICOMITKSeriesGDCMReader( unsigned int decimalPlacesForOrientation )
33 , m_FixTiltByShearing( true )
34 , m_DecimalPlacesForOrientation( decimalPlacesForOrientation )
35 , m_ExternalCache(false)
36 {
37  this->EnsureMandatorySortersArePresent( decimalPlacesForOrientation );
38 }
39 
40 
42 : DICOMFileReader( other )
43 , m_FixTiltByShearing( false )
44 , m_SortingResultInProgress( other.m_SortingResultInProgress )
45 , m_Sorter( other.m_Sorter )
46 , m_EquiDistantBlocksSorter( other.m_EquiDistantBlocksSorter->Clone() )
47 , m_NormalDirectionConsistencySorter( other.m_NormalDirectionConsistencySorter->Clone() )
48 , m_ReplacedCLocales( other.m_ReplacedCLocales )
49 , m_ReplacedCinLocales( other.m_ReplacedCinLocales )
50 , m_DecimalPlacesForOrientation( other.m_DecimalPlacesForOrientation )
51 , m_TagCache( other.m_TagCache )
52 , m_ExternalCache(other.m_ExternalCache)
53 {
54 }
55 
57 {
58 }
59 
62 {
63  if ( this != &other )
64  {
66  this->m_FixTiltByShearing = other.m_FixTiltByShearing;
67  this->m_SortingResultInProgress = other.m_SortingResultInProgress;
68  this->m_Sorter = other.m_Sorter; // TODO should clone the list items
69  this->m_EquiDistantBlocksSorter = other.m_EquiDistantBlocksSorter->Clone();
70  this->m_NormalDirectionConsistencySorter = other.m_NormalDirectionConsistencySorter->Clone();
71  this->m_ReplacedCLocales = other.m_ReplacedCLocales;
72  this->m_ReplacedCinLocales = other.m_ReplacedCinLocales;
73  this->m_DecimalPlacesForOrientation = other.m_DecimalPlacesForOrientation;
74  this->m_TagCache = other.m_TagCache;
75  }
76  return *this;
77 }
78 
80 {
81  if ( const Self* otherSelf = dynamic_cast<const Self*>( &other ) )
82  {
83  if ( this->m_FixTiltByShearing == otherSelf->m_FixTiltByShearing
84  && *( this->m_EquiDistantBlocksSorter ) == *( otherSelf->m_EquiDistantBlocksSorter )
85  && ( fabs( this->m_DecimalPlacesForOrientation - otherSelf->m_DecimalPlacesForOrientation ) < eps ) )
86  {
87  // test sorters for equality
88  if ( this->m_Sorter.size() != otherSelf->m_Sorter.size() )
89  return false;
90 
91  auto mySorterIter = this->m_Sorter.cbegin();
92  auto oSorterIter = otherSelf->m_Sorter.cbegin();
93  for ( ; mySorterIter != this->m_Sorter.cend() && oSorterIter != otherSelf->m_Sorter.cend();
94  ++mySorterIter, ++oSorterIter )
95  {
96  if ( !( **mySorterIter == **oSorterIter ) )
97  return false; // this sorter differs
98  }
99 
100  // nothing differs ==> all is equal
101  return true;
102  }
103  else
104  {
105  return false;
106  }
107  }
108  else
109  {
110  return false;
111  }
112 }
113 
115 {
116  this->Modified();
117  m_FixTiltByShearing = on;
118 }
119 
121 {
122  return m_FixTiltByShearing;
123 }
124 
126 {
127  this->Modified();
128  m_EquiDistantBlocksSorter->SetAcceptTwoSlicesGroups( accept );
129 }
130 
132 {
133  return m_EquiDistantBlocksSorter->GetAcceptTwoSlicesGroups();
134 }
135 
137 {
138  unsigned int sortIndex( 1 );
139  for ( auto sorterIter = m_Sorter.cbegin(); sorterIter != m_Sorter.cend(); ++sortIndex, ++sorterIter )
140  {
141  os << "Sorting step " << sortIndex << ":" << std::endl;
142  ( *sorterIter )->PrintConfiguration( os, " " );
143  }
144 
145  os << "Sorting step " << sortIndex << ":" << std::endl;
146  m_EquiDistantBlocksSorter->PrintConfiguration( os, " " );
147 }
148 
149 
151 {
152  return setlocale( LC_NUMERIC, nullptr );
153 }
154 
156 {
157  s_LocaleMutex->Lock();
158 
159  std::string currentCLocale = setlocale( LC_NUMERIC, nullptr );
160  m_ReplacedCLocales.push( currentCLocale );
161  setlocale( LC_NUMERIC, "C" );
162 
163  std::locale currentCinLocale( std::cin.getloc() );
164  m_ReplacedCinLocales.push( currentCinLocale );
165  std::locale l( "C" );
166  std::cin.imbue( l );
167 
168  s_LocaleMutex->Unlock();
169 }
170 
172 {
173  s_LocaleMutex->Lock();
174 
175  if ( !m_ReplacedCLocales.empty() )
176  {
177  setlocale( LC_NUMERIC, m_ReplacedCLocales.top().c_str() );
178  m_ReplacedCLocales.pop();
179  }
180  else
181  {
182  MITK_WARN << "Mismatched PopLocale on DICOMITKSeriesGDCMReader.";
183  }
184 
185  if ( !m_ReplacedCinLocales.empty() )
186  {
187  std::cin.imbue( m_ReplacedCinLocales.top() );
188  m_ReplacedCinLocales.pop();
189  }
190  else
191  {
192  MITK_WARN << "Mismatched PopLocale on DICOMITKSeriesGDCMReader.";
193  }
194 
195  s_LocaleMutex->Unlock();
196 }
197 
200 {
201  return input; // to be implemented differently by sub-classes
202 }
203 
204 #if defined( MBILOG_ENABLE_DEBUG ) || defined( ENABLE_TIMING )
205 #define timeStart( part ) timer.Start( part );
206 #define timeStop( part ) timer.Stop( part );
207 #else
208 #define timeStart( part )
209 #define timeStop( part )
210 #endif
211 
213 {
214  itk::TimeProbesCollectorBase timer;
215 
216  timeStart( "Reset" );
217  this->ClearOutputs();
218  timeStop( "Reset" );
219 
220  // prepare initial sorting (== list of input files)
221  const StringList inputFilenames = this->GetInputFiles();
222  timeStart( "Check input for DCM" );
223  if ( inputFilenames.empty() || !this->CanHandleFile( inputFilenames.front() ) // first
224  || !this->CanHandleFile( inputFilenames.back() ) // last
225  || !this->CanHandleFile( inputFilenames[inputFilenames.size() / 2] ) // roughly central file
226  )
227  {
228  // TODO a read-as-many-as-possible fallback could be implemented here
229  MITK_DEBUG << "Reader unable to process files..";
230  return;
231  }
232 
233  timeStop( "Check input for DCM" );
234 
235  // scan files for sorting-relevant tags
236  if ( m_TagCache.IsNull() || ( m_TagCache->GetMTime()<this->GetMTime() && !m_ExternalCache ))
237  {
238  timeStart( "Tag scanning" );
240 
241  filescanner->SetInputFiles( inputFilenames );
242  filescanner->AddTagPaths( this->GetTagsOfInterest() );
243 
244  PushLocale();
245  filescanner->Scan();
246  PopLocale();
247 
248  m_TagCache = filescanner->GetScanCache(); // keep alive and make accessible to sub-classes
249 
250  timeStop("Tag scanning");
251  }
252  else
253  {
254  // ensure that the tag cache contains our required tags AND files and has scanned!
255  }
256 
257  m_SortingResultInProgress.clear();
258  m_SortingResultInProgress.push_back(m_TagCache->GetFrameInfoList());
259 
260  // sort and split blocks as configured
261 
262  timeStart( "Sorting frames" );
263  unsigned int sorterIndex = 0;
264  for ( auto sorterIter = m_Sorter.cbegin(); sorterIter != m_Sorter.cend(); ++sorterIndex, ++sorterIter )
265  {
266  std::stringstream ss;
267  ss << "Sorting step " << sorterIndex;
268  timeStart( ss.str().c_str() );
269  m_SortingResultInProgress =
270  this->InternalExecuteSortingStep( sorterIndex, *sorterIter, m_SortingResultInProgress );
271  timeStop( ss.str().c_str() );
272  }
273 
274  // a last extra-sorting step: ensure equidistant slices
275  timeStart( "EquiDistantBlocksSorter" );
276  m_SortingResultInProgress = this->InternalExecuteSortingStep(
277  sorterIndex++, m_EquiDistantBlocksSorter.GetPointer(), m_SortingResultInProgress );
278  timeStop( "EquiDistantBlocksSorter" );
279 
280  timeStop( "Sorting frames" );
281 
282  timeStart( "Condensing 3D blocks" );
283  m_SortingResultInProgress = this->Condense3DBlocks( m_SortingResultInProgress );
284  timeStop( "Condensing 3D blocks" );
285 
286  // provide final result as output
287 
288  timeStart( "Output" );
289  unsigned int o = this->GetNumberOfOutputs();
290  this->SetNumberOfOutputs(
291  o + m_SortingResultInProgress.size() ); // Condense3DBlocks may already have added outputs!
292  for ( auto blockIter = m_SortingResultInProgress.cbegin(); blockIter != m_SortingResultInProgress.cend();
293  ++o, ++blockIter )
294  {
295  const DICOMDatasetAccessingImageFrameList& gdcmFrameInfoList = *blockIter;
296  assert( !gdcmFrameInfoList.empty() );
297 
298  // reverse frames if necessary
299  // update tilt information from absolute last sorting
300  const DICOMDatasetList datasetList = ConvertToDICOMDatasetList( gdcmFrameInfoList );
301  m_NormalDirectionConsistencySorter->SetInput( datasetList );
302  m_NormalDirectionConsistencySorter->Sort();
303  const DICOMDatasetAccessingImageFrameList sortedGdcmInfoFrameList =
304  ConvertToDICOMDatasetAccessingImageFrameList( m_NormalDirectionConsistencySorter->GetOutput( 0 ) );
305  const GantryTiltInformation& tiltInfo = m_NormalDirectionConsistencySorter->GetTiltInformation();
306 
307  // set frame list for current block
308  const DICOMImageFrameList frameList = ConvertToDICOMImageFrameList( sortedGdcmInfoFrameList );
309  assert( !frameList.empty() );
310 
312  block.SetTagCache( this->GetTagCache() ); // important: this must be before SetImageFrameList(), because
313  // SetImageFrameList will trigger reading of lots of interesting
314  // tags!
315  block.SetAdditionalTagsOfInterest( GetAdditionalTagsOfInterest() );
316  block.SetTagLookupTableToPropertyFunctor( GetTagLookupTableToPropertyFunctor() );
317  block.SetImageFrameList( frameList );
318  block.SetTiltInformation( tiltInfo );
319 
320  block.SetReaderImplementationLevel( this->GetReaderImplementationLevel( block.GetSOPClassUID() ) );
321 
322  this->SetOutput( o, block );
323  }
324  timeStop( "Output" );
325 
326 #if defined( MBILOG_ENABLE_DEBUG ) || defined( ENABLE_TIMING )
327  std::cout << "---------------------------------------------------------------" << std::endl;
328  timer.Report( std::cout );
329  std::cout << "---------------------------------------------------------------" << std::endl;
330 #endif
331 }
332 
334  unsigned int sortingStepIndex, const DICOMDatasetSorter::Pointer& sorter, const SortingBlockList& input )
335 {
336  SortingBlockList nextStepSorting; // we should not modify our input list while processing it
337  std::stringstream ss;
338  ss << "Sorting step " << sortingStepIndex << " '";
339 #if defined( MBILOG_ENABLE_DEBUG )
340  sorter->PrintConfiguration( ss );
341 #endif
342  ss << "'";
343  nextStepSorting.clear();
344 
345  MITK_DEBUG << "================================================================================";
346  MITK_DEBUG << "DICOMITKSeriesGDCMReader: " << ss.str() << ": " << input.size() << " groups input";
347  unsigned int groupIndex = 0;
348 
349  for ( auto blockIter = input.cbegin(); blockIter != input.cend(); ++groupIndex, ++blockIter )
350  {
351  const DICOMDatasetAccessingImageFrameList& gdcmInfoFrameList = *blockIter;
352  const DICOMDatasetList datasetList = ConvertToDICOMDatasetList( gdcmInfoFrameList );
353 
354 #if defined( MBILOG_ENABLE_DEBUG )
355  MITK_DEBUG << "--------------------------------------------------------------------------------";
356  MITK_DEBUG << "DICOMITKSeriesGDCMReader: " << ss.str() << ", dataset group " << groupIndex << " ("
357  << datasetList.size() << " datasets): ";
358  for ( auto oi = datasetList.cbegin(); oi != datasetList.cend(); ++oi )
359  {
360  MITK_DEBUG << " INPUT : " << ( *oi )->GetFilenameIfAvailable();
361  }
362 #endif
363 
364  sorter->SetInput( datasetList );
365  sorter->Sort();
366  unsigned int numberOfResultingBlocks = sorter->GetNumberOfOutputs();
367 
368  for ( unsigned int b = 0; b < numberOfResultingBlocks; ++b )
369  {
370  const DICOMDatasetList blockResult = sorter->GetOutput( b );
371 
372  for ( auto oi = blockResult.cbegin(); oi != blockResult.cend(); ++oi )
373  {
374  MITK_DEBUG << " OUTPUT(" << b << ") :" << ( *oi )->GetFilenameIfAvailable();
375  }
376 
378  nextStepSorting.push_back( sortedGdcmInfoFrameList );
379  }
380  }
381 
382  return nextStepSorting;
383 }
384 
387 {
388  if ( sopClassUID.empty() )
389  {
390  return SOPClassUnknown;
391  }
392 
393  gdcm::UIDs uidKnowledge;
394  uidKnowledge.SetFromUID( sopClassUID.c_str() );
395 
396  gdcm::UIDs::TSType gdcmType = uidKnowledge;
397 
398  switch ( gdcmType )
399  {
400  case gdcm::UIDs::CTImageStorage:
401  case gdcm::UIDs::MRImageStorage:
402  case gdcm::UIDs::PositronEmissionTomographyImageStorage:
403  case gdcm::UIDs::ComputedRadiographyImageStorage:
404  case gdcm::UIDs::DigitalXRayImageStorageForPresentation:
405  case gdcm::UIDs::DigitalXRayImageStorageForProcessing:
406  return SOPClassSupported;
407 
408  case gdcm::UIDs::NuclearMedicineImageStorage:
410 
411  case gdcm::UIDs::SecondaryCaptureImageStorage:
412  return SOPClassImplemented;
413 
414  default:
415  return SOPClassUnsupported;
416  }
417 }
418 
419 // void AllocateOutputImages();
420 
422 {
423  bool success = true;
424 
425  unsigned int numberOfOutputs = this->GetNumberOfOutputs();
426  for ( unsigned int o = 0; o < numberOfOutputs; ++o )
427  {
428  success &= this->LoadMitkImageForOutput( o );
429  }
430 
431  return success;
432 }
433 
435  DICOMImageBlockDescriptor& block ) const
436 {
437  PushLocale();
439  const GantryTiltInformation tiltInfo = block.GetTiltInformation();
440  bool hasTilt = tiltInfo.IsRegularGantryTilt();
441 
443  filenames.reserve( frames.size() );
444  for ( auto frameIter = frames.cbegin(); frameIter != frames.cend(); ++frameIter )
445  {
446  filenames.push_back( ( *frameIter )->Filename );
447  }
448 
450  bool success( true );
451  try
452  {
453  mitk::Image::Pointer mitkImage = helper.Load( filenames, m_FixTiltByShearing && hasTilt, tiltInfo );
454  block.SetMitkImage( mitkImage );
455  }
456  catch ( const std::exception& e )
457  {
458  success = false;
459  MITK_ERROR << "Exception during image loading: " << e.what();
460  }
461 
462  PopLocale();
463 
464  return success;
465 }
466 
467 
469 {
470  DICOMImageBlockDescriptor& block = this->InternalGetOutput( o );
471  return this->LoadMitkImageForImageBlockDescriptor( block );
472 }
473 
474 
476 {
478 }
479 
481 {
482  assert( sorter );
483 
484  if ( atFront )
485  {
486  m_Sorter.push_front( sorter );
487  }
488  else
489  {
490  m_Sorter.push_back( sorter );
491  }
492  this->Modified();
493 }
494 
497 {
498  std::list<DICOMDatasetSorter::ConstPointer> result;
499 
500  unsigned int sortIndex( 0 );
501  for ( auto sorterIter = m_Sorter.begin(); sorterIter != m_Sorter.end(); ++sortIndex, ++sorterIter )
502  {
503  if ( sortIndex > 0 ) // ignore first element (see EnsureMandatorySortersArePresent)
504  {
505  result.push_back( ( *sorterIter ).GetPointer() );
506  }
507  }
508 
509  return result;
510 }
511 
512 void mitk::DICOMITKSeriesGDCMReader::EnsureMandatorySortersArePresent(
513  unsigned int decimalPlacesForOrientation )
514 {
516  splitter->AddDistinguishingTag( DICOMTag(0x0028, 0x0010) ); // Number of Rows
517  splitter->AddDistinguishingTag( DICOMTag(0x0028, 0x0011) ); // Number of Columns
518  splitter->AddDistinguishingTag( DICOMTag(0x0028, 0x0030) ); // Pixel Spacing
519  splitter->AddDistinguishingTag( DICOMTag(0x0018, 0x1164) ); // Imager Pixel Spacing
520  splitter->AddDistinguishingTag( DICOMTag(0x0020, 0x0037), new mitk::DICOMTagBasedSorter::CutDecimalPlaces(decimalPlacesForOrientation) ); // Image Orientation (Patient)
521  splitter->AddDistinguishingTag( DICOMTag(0x0018, 0x0050) ); // Slice Thickness
522  splitter->AddDistinguishingTag( DICOMTag(0x0028, 0x0008) ); // Number of Frames
523  this->AddSortingElement( splitter, true ); // true = at front
524 
525  if ( m_EquiDistantBlocksSorter.IsNull() )
526  {
527  m_EquiDistantBlocksSorter = mitk::EquiDistantBlocksSorter::New();
528  }
529  m_EquiDistantBlocksSorter->SetAcceptTilt( m_FixTiltByShearing );
530 
531  if ( m_NormalDirectionConsistencySorter.IsNull() )
532  {
533  m_NormalDirectionConsistencySorter = mitk::NormalDirectionConsistencySorter::New();
534  }
535 }
536 
537 void mitk::DICOMITKSeriesGDCMReader::SetToleratedOriginOffsetToAdaptive( double fractionOfInterSliceDistance ) const
538 {
539  assert( m_EquiDistantBlocksSorter.IsNotNull() );
540  m_EquiDistantBlocksSorter->SetToleratedOriginOffsetToAdaptive( fractionOfInterSliceDistance );
541  this->Modified();
542 }
543 
545 {
546  assert( m_EquiDistantBlocksSorter.IsNotNull() );
547  m_EquiDistantBlocksSorter->SetToleratedOriginOffset( millimeters );
548  this->Modified();
549 }
550 
552 {
553  assert( m_EquiDistantBlocksSorter.IsNotNull() );
554  return m_EquiDistantBlocksSorter->GetToleratedOriginOffset();
555 }
556 
558 {
559  assert( m_EquiDistantBlocksSorter.IsNotNull() );
560  return m_EquiDistantBlocksSorter->IsToleratedOriginOffsetAbsolute();
561 }
562 
564 {
565  return m_DecimalPlacesForOrientation;
566 }
567 
569 {
570  return m_TagCache;
571 }
572 
574 {
575  m_TagCache = tagCache;
576  m_ExternalCache = tagCache.IsNotNull();
577 }
578 
580 {
581  DICOMTagPathList completeList;
582 
583  // check all configured sorters
584  for ( auto sorterIter = m_Sorter.cbegin(); sorterIter != m_Sorter.cend(); ++sorterIter )
585  {
586  assert( sorterIter->IsNotNull() );
587 
588  const DICOMTagList tags = ( *sorterIter )->GetTagsOfInterest();
589  completeList.insert( completeList.end(), tags.cbegin(), tags.cend() );
590  }
591 
592  // check our own forced sorters
593  DICOMTagList tags = m_EquiDistantBlocksSorter->GetTagsOfInterest();
594  completeList.insert( completeList.end(), tags.cbegin(), tags.cend() );
595 
596  tags = m_NormalDirectionConsistencySorter->GetTagsOfInterest();
597  completeList.insert( completeList.end(), tags.cbegin(), tags.cend() );
598 
599  // add the tags for DICOMImageBlockDescriptor
601  completeList.insert( completeList.end(), tags.cbegin(), tags.cend() );
602 
603 
604  const AdditionalTagsMapType tagList = GetAdditionalTagsOfInterest();
605  for ( auto iter = tagList.cbegin();
606  iter != tagList.cend();
607  ++iter
608  )
609  {
610  completeList.push_back( iter->first ) ;
611  }
612 
613  return completeList;
614 }
section MAP_FRAME_Mapper_Settings Mapper settings For the mapping of corrected you have several settings but high interpolation errors for gray value images Right choice for label images or masks li Details of the frame selection In this tab you can specify the frames of the currently selected image that should be corrected As default all frames of an image will be corrected If you only select specific frames
virtual bool CanHandleFile(const std::string &filename) override
Indicate whether this reader can handle given file.
const DICOMImageFrameList & GetImageFrameList() const
List of frames that constitute the mitk::Image (DICOMImageFrames)
virtual void InternalPrintConfiguration(std::ostream &os) const override
Configuration description for human reader, to be implemented by sub-classes.
loader did not yet inspect any images, unknown fitness
itk::SmartPointer< Self > Pointer
virtual bool operator==(const DICOMFileReader &other) const override
Pointer Clone() const
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
bool IsRegularGantryTilt() const
Whether the shearing is a gantry tilt or more complicated.
Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT...
#define MITK_ERROR
Definition: mitkLogMacros.h:24
static bool CanHandleFile(const std::string &filename)
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:64
static std::string GetActiveLocale()
Return active C locale.
void SetTagCache(const DICOMTagCache::Pointer &) override
A way to provide external knowledge about files and tag values is appreciated.
void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct=0.3) const
See Forced Configuration.
mitk::EquiDistantBlocksSorter::Pointer m_EquiDistantBlocksSorter
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:37
Image::Pointer Load(const StringContainer &filenames, bool correctTilt, const GantryTiltInformation &tiltInfo)
virtual void AnalyzeInputFiles() override
Runs the sorting / splitting process described in Loading strategy. Method required by DICOMFileReade...
void SetFixTiltByShearing(bool on)
Controls whether to "fix" tilted acquisitions by shearing the output (see Gantry tilt handling)...
ConstSorterList GetFreelyConfiguredSortingElements() const
#define MITK_DEBUG
Definition: mitkLogMacros.h:26
const GantryTiltInformation GetTiltInformation() const
Describe the gantry tilt of the acquisition.
void SetAcceptTwoSlicesGroups(bool accept) const
Controls whether groups of only two images are accepted when ensuring consecutive slices via EquiDist...
MITKDICOMREADER_EXPORT mitk::DICOMDatasetList ConvertToDICOMDatasetList(const DICOMDatasetAccessingImageFrameList &input)
virtual DICOMTagCache::Pointer GetTagCache() const
loader code and tests are established
virtual SortingBlockList Condense3DBlocks(SortingBlockList &resultOf3DGrouping)
"Hook" for sub-classes, see Sub-classes can condense multiple blocks into a single larger block ...
MITKDICOMREADER_EXPORT mitk::DICOMDatasetAccessingImageFrameList ConvertToDICOMDatasetAccessingImageFrameList(const DICOMDatasetList &input)
static Pointer New()
void PopLocale() const
Activate last remembered locale from locale stack "C" locale is required for correct parsing of numbe...
virtual bool LoadImages() override
Loads images using itk::ImageSeriesReader, potentially applies shearing to correct gantry tilt...
static SortingBlockList InternalExecuteSortingStep(unsigned int sortingStepIndex, const DICOMDatasetSorter::Pointer &sorter, const SortingBlockList &input)
Sorting step as described in Loading strategy.
loader code is not known to work with this SOP Class
loader code is implemented but not accompanied by tests
void SetMitkImage(Image::Pointer image)
The 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList.
#define timeStart(part)
const std::list< DICOMDatasetSorter::ConstPointer > ConstSorterList
ReaderImplementationLevel
Describes how well the reader is tested for a certain file type (see mitk::DICOMFileReader).
#define MITK_WARN
Definition: mitkLogMacros.h:23
void PushLocale() const
Remember current locale on stack, activate "C" locale. "C" locale is required for correct parsing of ...
static const std::string filename
std::vector< DICOMImageFrameInfo::Pointer > DICOMImageFrameList
DICOMImageBlockDescriptor::AdditionalTagsMapType AdditionalTagsMapType
virtual bool LoadMitkImageForImageBlockDescriptor(DICOMImageBlockDescriptor &block) const
DICOMITKSeriesGDCMReader(unsigned int decimalPlacesForOrientation=5)
Output descriptor for DICOMFileReader.
void SetTagCache(DICOMTagCache *privateCache)
virtual void AddSortingElement(DICOMDatasetSorter *sorter, bool atFront=false)
Add an element to the sorting procedure described in Loading strategy.
virtual bool LoadMitkImageForOutput(unsigned int o)
Loads the mitk::Image by means of an itk::ImageSeriesReader.
std::vector< std::string > StringList
std::vector< DICOMTagPath > DICOMTagPathList
std::vector< DICOMDatasetAccessingImageFrameList > SortingBlockList
MITKDICOMREADER_EXPORT mitk::DICOMImageFrameList ConvertToDICOMImageFrameList(const DICOMDatasetAccessingImageFrameList &input)
void SetToleratedOriginOffset(double millimeters=0.005) const
See Forced Configuration.
static ReaderImplementationLevel GetReaderImplementationLevel(const std::string sopClassUID)
Describe this reader's confidence for given SOP class UID.
std::vector< DICOMDatasetAccessingImageFrameInfo::Pointer > DICOMDatasetAccessingImageFrameList
Cuts a number after configured number of decimal places. An instance of this class can be used to avo...
Gantry tilt analysis result.
loader code and tests are establised for specific parts of a SOP Class
DICOMITKSeriesGDCMReader & operator=(const DICOMITKSeriesGDCMReader &other)
MITKCORE_EXPORT const ScalarType eps
DICOMFileReader & operator=(const DICOMFileReader &other)
std::vector< DICOMDatasetAccess * > DICOMDatasetList
Interface for DICOM readers that produce mitk::Images.
#define timeStop(part)
mitk::NormalDirectionConsistencySorter::Pointer m_NormalDirectionConsistencySorter
virtual DICOMTagPathList GetTagsOfInterest() const override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.