Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDiffusionHeaderDICOMFileReader.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 
18 
21 {
22 
23 }
24 
27 {
28 
29 }
30 
34 {
35  if( m_HeaderInformationList.size() < 1 )
36  {
37  MITK_WARN << "No information retrieved yet. Call AnalyzeInputFiles first!";
38  }
39 
40  return m_HeaderInformationList;
41 }
42 
43 bool mitk::RevealBinaryTag(const gdcm::Tag tag, const gdcm::DataSet& dataset, std::string& target)
44 {
45  if( dataset.FindDataElement( tag ) )
46  {
47  MITK_DEBUG << "Found tag " << tag.PrintAsPipeSeparatedString();
48 
49  const gdcm::DataElement& de = dataset.GetDataElement( tag );
50  target = std::string( de.GetByteValue()->GetPointer(),
51  de.GetByteValue()->GetLength() );
52  return true;
53 
54  }
55  else
56  {
57  MITK_DEBUG << "Could not find tag " << tag.PrintAsPipeSeparatedString();
58  return false;
59  }
60 }
61 
62 bool mitk::RevealBinaryTagC(const gdcm::Tag tag, const gdcm::DataSet& dataset, char * target_array )
63 {
64  if( dataset.FindDataElement( tag ) )
65  {
66  MITK_DEBUG << "Found tag " << tag.PrintAsPipeSeparatedString();
67 
68  const gdcm::DataElement& de = dataset.GetDataElement( tag );
69 
70  size_t bytesize = de.GetValue().GetLength(); // GetLength();
71  //target_array = new char[bytesize];
72  memcpy( target_array, de.GetByteValue()->GetPointer(), bytesize);
73 
74  return true;
75 
76  }
77  else
78  {
79  MITK_DEBUG << "Could not find tag " << tag.PrintAsPipeSeparatedString();
80  return false;
81  }
82 }
bool RevealBinaryTag(const gdcm::Tag tag, const gdcm::DataSet &dataset, std::string &target)
Retrieve the value of a gdcm tag to the given string.
#define MITK_DEBUG
Definition: mitkLogMacros.h:26
#define MITK_WARN
Definition: mitkLogMacros.h:23
std::vector< DiffusionImageDICOMHeaderInformation > DICOMHeaderListType
bool RevealBinaryTagC(const gdcm::Tag tag, const gdcm::DataSet &dataset, char *target_array)