SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkMrsImageData.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2009-2014 The Regents of the University of California.
3  * All Rights Reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * • Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * • Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12  * • None of the names of any campus of the University of California, the name
13  * "The Regents of the University of California," or the names of any of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
26  * OF SUCH DAMAGE.
27  */
28 
29 
30 
31 /*
32  * $URL$
33  * $Rev$
34  * $Author$
35  * $Date$
36  *
37  * Authors:
38  * Jason C. Crane, Ph.D.
39  * Beck Olson
40  */
41 
42 
43 #ifndef SVK_MRS_IMAGE_DATA_H
44 #define SVK_MRS_IMAGE_DATA_H
45 
46 
47 #include <vtkObjectFactory.h>
48 #include <vtkImageData.h>
49 #include <vtkUnstructuredGrid.h>
50 #include <vtkPlanesIntersection.h>
51 #include <vtkHexahedron.h>
52 #include <svk4DImageData.h>
53 #include <svkMriImageData.h>
54 
55 
56 namespace svk {
57 
58 
67 {
68 
69  public:
70 
72  typedef enum {
73  TIMEPOINT = 0,
76 
78  static svkMrsImageData* New();
79  static vtkObject* NewObject();
80 
81  void GetIndexArray( int timePoint, int channel, int* indexArray );
82  vtkDataArray* GetSpectrum( int i );
83  vtkDataArray* GetSpectrum( int i, int j, int k, int timePoint = 0, int channel=0 );
84  vtkDataArray* GetSpectrumFromID( int index, int timePoint = 0, int channel = 0 );
85  void GetImage(
86  svkMriImageData* image,
87  int point,
88  int timePoint,
89  int channel,
90  int component,
91  vtkstd::string seriesDescription,
92  int vtkDataType = VTK_VOID
93  );
94 
95  void GetImage(
96  svkMriImageData* image,
97  int point,
98  svkDcmHeader::DimensionVector* dimensionVector,
99  int component,
100  string seriesDescription,
101  int vtkDataType = VTK_VOID
102  );
103 
104  void SetImage( vtkImageData* image, int point, int timePoint = 0, int channel = 0 );
105  void SetImage( vtkImageData* image, int point, svkDcmHeader::DimensionVector* dimensionVector );
106  void SetImageComponent( vtkImageData* image, int point, int timePoint = 0, int channel = 0, int component = 0); // real
107 
108  int GetClosestSlice(double* posLPS, svkDcmHeader::Orientation sliceOrientation, double tolerance = -1 );
109 
110  void EstimateDataRange( double range[2], int minPt, int maxPt, int component, int* tlcBrc = NULL, int timePoint = 0, int channel = 0 );
111 
112  int GetVolumeIndexSize( int volumeIndex );
114  int GetNumberOfChannels();
115 
116  bool HasSelectionBox( );
117  void GenerateSelectionBox( vtkUnstructuredGrid* selectionBox );
118  void GetSelectionBoxCenter( double* selBoxCenter );
119  void GetSelectionBoxDimensions( float* dims );
121  void GetSelectionBoxSpacing( double spacing[3] );
122  void GetSelectionBoxOrigin( double origin[3] );
123  void GetSelectionBoxMaxMin( double minPoint[3], double maxPoint[3], double tolerance = DEFAULT_SELECTION_TOLERANCE );
125  int tlcBrc[2],
126  svkDcmHeader::Orientation orientation,
127  int slice,
128  double tolerance = DEFAULT_SELECTION_TOLERANCE
129  );
130 
132  int tlcVoxel[3],
133  int brcVoxel[3],
134  double tolerance = DEFAULT_SELECTION_TOLERANCE
135  );
136 
137  void GetSelectionBoxMask( short* mask, double tolerance = DEFAULT_SELECTION_TOLERANCE );
138 
140  int tlcBrc[2],
141  double tolerance = DEFAULT_SELECTION_TOLERANCE
142  );
143  void Redimension( svkDcmHeader::DimensionVector* dimensionVector, double* newOrigin, double* newSpacing, bool resizeSelectionBoxToFOV = false );
144  void InitializeDataArrays( );
145 
146  protected:
147 
148  svkMrsImageData();
150 
151  private:
152 
153  int numChannels;
154 
155  void GetTlcBrcInSelectionBox(
156  int tlcBrc[2],
158  int slice = -1 ,
159  double tolerance = DEFAULT_SELECTION_TOLERANCE
160  );
161 
162 };
163 
164 
165 } //svk
166 
167 
168 #endif //SVK_MRS_IMAGE_DATA_H
169 
void GenerateSelectionBox(vtkUnstructuredGrid *selectionBox)
Definition: svkMrsImageData.cc:327
static svkMrsImageData * New()
void GetSelectionBoxMask(short *mask, double tolerance=DEFAULT_SELECTION_TOLERANCE)
Definition: svkMrsImageData.cc:848
void GetSelectionBoxMaxMin(double minPoint[3], double maxPoint[3], double tolerance=DEFAULT_SELECTION_TOLERANCE)
Definition: svkMrsImageData.cc:677
Definition: svkMrsImageData.h:66
void GetSelectionBoxCenter(double *selBoxCenter)
Definition: svkMrsImageData.cc:441
#define DEFAULT_SELECTION_TOLERANCE
Definition: svk4DImageData.h:55
void GetIndexArray(int timePoint, int channel, int *indexArray)
Definition: svkMrsImageData.cc:88
vtkDataArray * GetSpectrumFromID(int index, int timePoint=0, int channel=0)
Definition: svkMrsImageData.cc:110
bool IsSliceInSelectionBox(int slice, svkDcmHeader::Orientation orientation=svkDcmHeader::UNKNOWN_ORIENTATION)
Definition: svkMrsImageData.cc:491
void Redimension(svkDcmHeader::DimensionVector *dimensionVector, double *newOrigin, double *newSpacing, bool resizeSelectionBoxToFOV=false)
Definition: svkMrsImageData.cc:909
void InitializeDataArrays()
Definition: svkMrsImageData.cc:942
double range[3][2]
Range needs to be able to accomodate real, imaginary, and magnitude components.
Definition: svkImageData.h:280
static vtkObject * NewObject()
Definition: svkMrsImageData.cc:73
~svkMrsImageData()
Definition: svkMrsImageData.cc:65
void GetSelectionBoxOrigin(double origin[3])
Definition: svkMrsImageData.cc:608
Definition: svkMrsImageData.h:73
int GetNumberOfVolumeDimensions()
Definition: svkMrsImageData.cc:267
Orientation
Definition: svkDcmHeader.h:101
void Get2DProjectedTlcBrcInSelectionBox(int tlcBrc[2], svkDcmHeader::Orientation orientation, int slice, double tolerance=DEFAULT_SELECTION_TOLERANCE)
Definition: svkMrsImageData.cc:754
void EstimateDataRange(double range[2], int minPt, int maxPt, int component, int *tlcBrc=NULL, int timePoint=0, int channel=0)
Definition: svkMrsImageData.cc:296
void GetSelectionBoxDimensions(float *dims)
Definition: svkMrsImageData.cc:469
vtkTypeMacro(svkMrsImageData, svk4DImageData)
Definition: svkMrsImageData.h:74
void SetImageComponent(vtkImageData *image, int point, int timePoint=0, int channel=0, int component=0)
Definition: svkMrsImageData.cc:208
filterDimVec for all dims
Definition: svkFlatten.cc:9
void Get3DTlcBrcInSelectionBox(int tlcBrc[2], double tolerance=DEFAULT_SELECTION_TOLERANCE)
Definition: svkMrsImageData.cc:836
void GetSelectionBoxSpacing(double spacing[3])
Definition: svkMrsImageData.cc:560
vtkDataArray * GetSpectrum(int i)
Definition: svkMrsImageData.cc:101
int GetNumberOfChannels()
Definition: svkMrsImageData.cc:276
void GetImage(svkMriImageData *image, int point, int timePoint, int channel, int component, vtkstd::string seriesDescription, int vtkDataType=VTK_VOID)
Definition: svk4DImageData.h:69
void SetImage(vtkImageData *image, int point, int timePoint=0, int channel=0)
Definition: svkMrsImageData.cc:177
Definition: svkMriImageData.h:72
bool HasSelectionBox()
Definition: svkMrsImageData.cc:311
vector< map< svkDcmHeader::DimensionIndexLabel, int > > DimensionVector
Definition: svkDcmHeader.h:131
void Get3DVoxelsInSelectionBox(int tlcVoxel[3], int brcVoxel[3], double tolerance=DEFAULT_SELECTION_TOLERANCE)
Definition: svkMrsImageData.cc:819
int GetClosestSlice(double *posLPS, svkDcmHeader::Orientation sliceOrientation, double tolerance=-1)
Definition: svkMrsImageData.cc:222
MrsVolumeIndex
Enum represents objects in the scene.
Definition: svkMrsImageData.h:72
svkMrsImageData()
Definition: svkMrsImageData.cc:56
int GetVolumeIndexSize(int volumeIndex)
Definition: svkMrsImageData.cc:250
Definition: svkDcmHeader.h:102