Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkSubImageSelector.h"
14 
16 {
17 }
18 
20 {
21  mitk::Image::Pointer input = this->GetInput();
22  return input->GetSliceData(s, t, n);
23 }
24 
26 {
27  mitk::Image::Pointer input = this->GetInput();
28  return input->GetVolumeData(t, n);
29 }
30 
32 {
33  mitk::Image::Pointer input = this->GetInput();
34  return input->GetChannelData(n);
35 }
36 
38 {
39  mitk::Image::Pointer output = this->GetOutput();
40  if (output->IsValidChannel(n) == false)
41  return;
42  output->m_Channels[n] = dataItem;
43 }
44 
46 {
47  mitk::Image::Pointer output = this->GetOutput();
48  if (output->IsValidVolume(t, n) == false)
49  return;
50  int pos;
51  pos = output->GetVolumeIndex(t, n);
52  output->m_Volumes[pos] = dataItem;
53 }
54 
56 {
57  mitk::Image::Pointer output = this->GetOutput();
58  if (output->IsValidSlice(s, t, n) == false)
59  return;
60  int pos;
61  pos = output->GetSliceIndex(s, t, n);
62  output->m_Slices[pos] = dataItem;
63 }
64 
66 {
67 }
68 
70 {
71 }
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)
void SetVolumeItem(mitk::Image::ImageDataItemPointer dataItem, int t=0, int n=0)
InputImageType * GetInput(void)
void SetChannelItem(mitk::Image::ImageDataItemPointer dataItem, int n=0)
OutputType * GetOutput()
Get the output data of this image source object.
mitk::Image::ImageDataItemPointer GetChannelData(int n=0)