SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkMriImageData.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_MRI_IMAGE_DATA_H
44 #define SVK_MRI_IMAGE_DATA_H
45 
46 #define START_NUM_BINS 256
47 #define MAX_NUM_BINS 1048576
48 #define MIN_USED_BINS 10
49 #define EXCLUDE_FACTOR 0.05
50 
51 #include <vtkObjectFactory.h>
52 #include <svkImageData.h>
53 #include <svk4DImageData.h>
54 #include <vtkImageAccumulate.h>
55 #include <vtkCallbackCommand.h>
56 #include <vtkPolyData.h>
57 #include <svkFastCellData.h>
58 
59 
60 namespace svk {
61 
62 
63 using namespace std;
64 
65 
73 {
74 
75  public:
76 
77  vtkTypeMacro( svkMriImageData, svkImageData);
78  static svkMriImageData* New();
79  static vtkObject* NewObject();
80 
81 
82  double* GetImagePixels( int slice );
83  vtkDataArray* GetImagePixelsArray( int slice );
84  double* GetImagePixel( int id );
85  double* GetImagePixel( int x, int y, int z );
86  void SetImagePixels( double* pixels, int slice);
87  void SetImagePixel( int id, double value );
88  void SetImagePixel( int x, int y, int z, double value );
89  virtual void GetNumberOfVoxels(int numVoxels[3]);
90  void GetAutoWindowLevel( double& window, double& level, int numBins = START_NUM_BINS
91  , double excludeFactor = EXCLUDE_FACTOR );
92  virtual int GetVolumeIndexForFrame(int frame );
93  void GetCenterOfMass( double centerOfMass[3], int component = 0 );
94  virtual svk4DImageData* GetCellDataRepresentation();
95  void SyncPixelDataToCellRepresentation();
96  void SyncCellRepresentationToPixelData();
97 
98 
99  static void UpdatePixelData(vtkObject* subject, unsigned long eid, void* thisObject, void *calldata);
100 
101 
102  protected:
103 
104  svkMriImageData();
105  ~svkMriImageData();
106 
107  enum ActorType {PLOT_GRID};
108 
109  private:
110 
111  svk4DImageData* cellDataRepresentation;
112  double* pixelBuffer;
113  vtkCallbackCommand* cellRepresentationModifiedCB;
114  void InitializeCellDataArrays();
115 };
116 
117 
118 } //svk
119 
120 
121 #endif //SVK_MRI_IMAGE_DATA_H
122 
ActorType
Definition: svkMriImageData.h:107
#define START_NUM_BINS
Definition: svkMriImageData.h:46
Definition: svk4DImageData.h:69
Definition: svkMriImageData.h:72
Definition: svkImageData.h:107
#define EXCLUDE_FACTOR
Definition: svkMriImageData.h:49