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
mitkSubImageSelector.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 "mitkSubImageSelector.h"
18 
20 {
21 }
22 
24 {
25  mitk::Image::Pointer input = const_cast<mitk::Image *>(this->GetInput());
26  return input->GetSliceData(s, t, n);
27 }
28 
30 {
31  mitk::Image::Pointer input = const_cast<mitk::Image *>(this->GetInput());
32  return input->GetVolumeData(t, n);
33 }
34 
36 {
37  mitk::Image::Pointer input = const_cast<mitk::Image *>(this->GetInput());
38  return input->GetChannelData(n);
39 }
40 
42 {
43  mitk::Image::Pointer output = this->GetOutput();
44  if (output->IsValidChannel(n) == false)
45  return;
46  output->m_Channels[n] = dataItem;
47 }
48 
50 {
51  mitk::Image::Pointer output = this->GetOutput();
52  if (output->IsValidVolume(t, n) == false)
53  return;
54  int pos;
55  pos = output->GetVolumeIndex(t, n);
56  output->m_Volumes[pos] = dataItem;
57 }
58 
60 {
61  mitk::Image::Pointer output = this->GetOutput();
62  if (output->IsValidSlice(s, t, n) == false)
63  return;
64  int pos;
65  pos = output->GetSliceIndex(s, t, n);
66  output->m_Slices[pos] = dataItem;
67 }
68 
70 {
71 }
72 
74 {
75 }
virtual void SetPosNr(int p)
mitk::Image::ImageDataItemPointer GetVolumeData(int t=0, int n=0)
mitk::Image::ImageDataItemPointer GetSliceData(int s=0, int t=0, int n=0)
void SetSliceItem(mitk::Image::ImageDataItemPointer dataItem, int s=0, int t=0, int n=0)
Image class for storing images.
Definition: mitkImage.h:76
void SetVolumeItem(mitk::Image::ImageDataItemPointer dataItem, int t=0, int n=0)
void SetChannelItem(mitk::Image::ImageDataItemPointer dataItem, int n=0)
mitk::Image::ImageDataItemPointer GetChannelData(int n=0)