Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkUSImage.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 #include "mitkUSImage.h"
18 #include <mitkStringProperty.h>
19 #include <mitkProperties.h>
20 #include <mitkImageReadAccessor.h>
21 
22 
24 {
26 }
27 
29 {
30  try
31  {
32  this->Initialize(image);
33  mitk::ImageReadAccessor imgA(image, image->GetVolumeData(0));
34  this->SetVolume(imgA.GetData());
35  }
36  catch(mitk::Exception e)
37  {
38  mitkReThrow(e) << "Cannot access image data while constructing US image";
39  }
40 }
41 
43 {
44 
45 }
46 
49 
50  result->SetDeviceManufacturer(this->GetProperty(mitk::USImageMetadata::PROP_DEV_MANUFACTURER)->GetValueAsString());
51  result->SetDeviceModel( this->GetProperty(mitk::USImageMetadata::PROP_DEV_MODEL)->GetValueAsString());
52  result->SetDeviceComment( this->GetProperty(mitk::USImageMetadata::PROP_DEV_COMMENT)->GetValueAsString());
53  result->SetDeviceIsVideoOnly( this->GetProperty(mitk::USImageMetadata::PROP_DEV_ISVIDEOONLY));
54  result->SetDeviceIsCalibrated(this->GetProperty(mitk::USImageMetadata::PROP_DEV_ISCALIBRATED));
55  result->SetProbeName( this->GetProperty(mitk::USImageMetadata::PROP_PROBE_NAME)->GetValueAsString());
56  result->SetProbeFrequency( this->GetProperty(mitk::USImageMetadata::PROP_PROBE_FREQUENCY)->GetValueAsString());
57  result->SetZoom( this->GetProperty(mitk::USImageMetadata::PROP_ZOOM)->GetValueAsString());
58 
59  return result;
60 }
61 
62 
64  this->SetProperty(mitk::USImageMetadata::PROP_DEV_MANUFACTURER, mitk::StringProperty::New(metadata->GetDeviceManufacturer()));
65  this->SetProperty(mitk::USImageMetadata::PROP_DEV_MODEL, mitk::StringProperty::New(metadata->GetDeviceModel()));
66  this->SetProperty(mitk::USImageMetadata::PROP_DEV_COMMENT, mitk::StringProperty::New(metadata->GetDeviceComment()));
67  this->SetProperty(mitk::USImageMetadata::PROP_DEV_ISVIDEOONLY, mitk::BoolProperty::New(metadata->GetDeviceIsVideoOnly()));
68  this->SetProperty(mitk::USImageMetadata::PROP_DEV_ISCALIBRATED, mitk::BoolProperty::New(metadata->GetDeviceIsCalibrated()));
69  this->SetProperty(mitk::USImageMetadata::PROP_PROBE_NAME, mitk::StringProperty::New(metadata->GetProbeName()));
70  this->SetProperty(mitk::USImageMetadata::PROP_PROBE_FREQUENCY, mitk::StringProperty::New(metadata->GetProbeFrequency()));
71  this->SetProperty(mitk::USImageMetadata::PROP_ZOOM, mitk::StringProperty::New(metadata->GetZoom()));
72 }
73 
static const char * PROP_DEV_MODEL
USImage()
This constructor creates an empty USImage. The Metadata are set to default.
Definition: mitkUSImage.cpp:23
itk::SmartPointer< Self > Pointer
virtual void Initialize() override
Definition: mitkImage.cpp:802
mitk::USImageMetadata::Pointer GetMetadata() const
Reads out this image's Metadata set from the properties and returns a corresponding USImageMetadata o...
Definition: mitkUSImage.cpp:47
DataCollection - Class to facilitate loading/accessing structured data.
void SetMetadata(mitk::USImageMetadata::Pointer metadata)
Writes the information of the metadata object into the image's properties.
Definition: mitkUSImage.cpp:63
#define mitkReThrow(mitkexception)
virtual ~USImage()
Definition: mitkUSImage.cpp:42
virtual bool SetVolume(const void *data, int t=0, int n=0)
Set data as volume at time t in channel n. It is in the responsibility of the caller to ensure that t...
Definition: mitkImage.cpp:673
static Pointer New()
static const char * PROP_PROBE_FREQUENCY
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
Definition: mitkException.h:49
static const char * PROP_PROBE_NAME
Image class for storing images.
Definition: mitkImage.h:76
static const char * PROP_DEV_ISVIDEOONLY
static const char * PROP_DEV_ISCALIBRATED
static const char * PROP_DEV_COMMENT
ImageReadAccessor class to get locked read access for a particular image part.
static const char * PROP_DEV_MANUFACTURER
static const char * PROP_ZOOM
static Pointer New()
static Pointer New()