MeVisLab Toolbox Reference
mlMultiFileVolumeListDraftView.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //======================================================
5 
12 
13 //======================================================
14 #pragma once
15 
16 // ML-includes
18 #include <ThirdPartyWarningsDisable.h>
19 #include <Inventor/nodes/SoSeparator.h>
20 #include <Inventor/SbLinear.h>
21 #include <ThirdPartyWarningsRestore.h>
22 #include <mlModuleIncludes.h>
24 #include <mlZTUFileNameSet.h>
26 #include <mlMultiFileVolumeList.h>
27 #include <mlMultiFileVolume.h>
28 
29 ML_START_NAMESPACE
30 
33 
34  //---------------------------------------------------------------------------------
36  //---------------------------------------------------------------------------------
38 
39  public:
40 
44 
46  virtual ~MultiFileVolumeListDraftView() override;
47 
49  struct FrameInfo {
52  volumeList(volList),
53  numVolumes(0),
54  volumeIndex(0),
55  volume(NULL),
56  fileNameSet(NULL),
57  zFrameIndex(0),
58  tFrameIndex(0),
59  uFrameIndex(0),
60  fileHandle(""),
61  dcmTree(),
62  allowDrawing(true),
63  localRoot(NULL),
64  shapeGeometry(NULL),
65  orientation(NULL),
66  xExt(0), yExt(0), zExt(0), tExt(0),
67  posX (0), posY (0), posZ (0),
68  oriX0 (1), oriX1 (0), oriX2 (0),
69  oriY0 (0), oriY1 (1), oriY2 (0),
70  scaleX(1), scaleY(1), scaleZ(1),
71  red (1), green (1), blue (1), alpha(0)
72  {}
73 
77  size_t numVolumes;
79  size_t volumeIndex;
85  size_t numZFrames;
87  size_t numTFrames;
89  size_t numUFrames;
91  size_t zFrameIndex;
93  size_t tFrameIndex;
95  size_t uFrameIndex;
103  SoSeparator *localRoot;
105  SoSeparator *shapeGeometry;
107  SoSeparator *orientation;
109  int xExt, yExt, zExt, tExt;
112  double posX, posY, posZ;
115  double oriX0, oriX1, oriX2;
118  double oriY0, oriY1, oriY2;
121  double oriZ0, oriZ1, oriZ2;
124  double scaleX, scaleY, scaleZ;
127  double red, green, blue, alpha;
129  };
130 
131 
132  protected:
134  virtual void activateAttachments() override;
135 
137  virtual void handleNotification(Field* field) override;
138 
141 
144 
147  void _updateVis();
148 
151 
162  void _calculateVolumeShift(const FrameInfo& frameInfo,
163  size_t timePoint,
164  bool &appendDots,
165  bool &allowDrawing,
166  double &dotShiftX,
167  double &dotShiftY,
168  double &dotShiftZ) const;
169 
172 
174  void _appendVolumeList(FrameInfo &volumeListInfo);
175 
178  void _appendVolume(FrameInfo &volumeInfo);
179 
182 
185  void _appendFileNameSet(FrameInfo &fileNameSetInfo);
186 
188  void _appendFileHandle(FrameInfo &handleInfo);
189 
192  void _appendDCMTree(FrameInfo &dcmTreeInfo);
193 
196  void _appendPagedImage(FrameInfo &frameInfo, const PagedImage &imgProps);
197 
200 
202  void _appendLocalRoot(FrameInfo& frameInfo);
203 
205  void _appendColorSettings(FrameInfo& frameInfo);
206 
209 
212 
216  void _appendVolumeShift(FrameInfo& frameInfo, size_t overrideTimePoint=0u);
217 
220 
223 
225  void _appendShapeGeometry(FrameInfo& frameInfo);
226 
229 
230  private:
232  StringField *_volumeIndexesFld;
233 
235  DoubleField *_relative3DVolumeDistanceScaleXFld;
236  DoubleField *_relative3DVolumeDistanceScaleYFld;
237  DoubleField *_relative3DVolumeDistanceScaleZFld;
239 
241  DoubleField *_relativeNDVolumeDistanceScaleXFld;
242  DoubleField *_relativeNDVolumeDistanceScaleYFld;
243  DoubleField *_relativeNDVolumeDistanceScaleZFld;
245 
248  DoubleField *_extraVoxelScaleZFld;
249 
251  FloatField *_fontSizeFld;
252 
254  BoolField *_showAnnotationFld;
255 
257  BoolField *_showImagePositionPatientFld;
258 
260  BoolField *_showVolumeOrientationFld;
261 
263  BoolField *_showOnly12NTimePointsFld;
264 
266  StringField *_infoFld;
267 
269  NotifyField *_setConvenienceDefaultsFld;
270 
272  NotifyField *_setGeometricDefaultsFld;
273 
275  SoNodeField *_inventorInputFld;
276 
278  SoNodeField *_viewOutFld;
279 
281  SoSeparator *_root;
282 
285  };
286 
287 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_MULITIFLE_VOLUME_LIST_INVENTOR_OUTPUTS_EXPORT
DLL export macro definition.
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Field to encapsulate a double value.
Definition: mlFields.h:806
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate a float value.
Definition: mlFields.h:627
The ML module base class MultiFileVolumeListBaseOutput used to implement further output modules for t...
A visualization class for the structure of a MultiFileVolume; work in progress.
void _appendLocalRoot(FrameInfo &frameInfo)
Appends the Open Inventor root for the local scene or the frame.
void _appendFileHandle(FrameInfo &handleInfo)
Appends the frames corresponding to the given fileHandle.
void _appendDotsAtVolumeLocation2(FrameInfo &frameInfo)
Append text which draws "..." at center of volume at position 2.
void _appendColorSettings(FrameInfo &frameInfo)
Appends the Open Inventor color settings for the frame.
void _setGeometricDefaults()
Sets fields to values such that volumes are displayed at their geometric correct position even if the...
void _updateVis()
Removes all currently displayed frames and adds those from the currently loaded or connected volume l...
void _appendTransformation(FrameInfo &frameInfo)
Appends the Open Inventor transformation of the frame.
void _appendHandMadeTransformation(FrameInfo &frameInfo)
Appends the Open Inventor frame transformations built manually from DCMTree tags.
void _appendVolumeCoordinateSystem(FrameInfo frameInfo)
Appends the volume coordinate system if enabled.
void _appendFrameInventorScene(FrameInfo &frameInfo)
Appends the Open Inventor scene graph for a frame.
void _appendDCMTree(FrameInfo &dcmTreeInfo)
Appends the frame defined by the given DCMTree if it is valid, otherwise it does nothing.
void _appendShapeGeometry(FrameInfo &frameInfo)
Appends the Open Inventor line geometry of the frame for a single time point.
virtual ~MultiFileVolumeListDraftView() override
Destructor.
void _calculateVolumeShift(const FrameInfo &frameInfo, size_t timePoint, bool &appendDots, bool &allowDrawing, double &dotShiftX, double &dotShiftY, double &dotShiftZ) const
Calculates whether the current volume or frame given by frameInfo shall (and where to) be drawn or wh...
void _appendPagedImage(FrameInfo &frameInfo, const PagedImage &imgProps)
Appends the frame or volume defined by the given PagedImage if it is valid, otherwise it does nothing...
void _appendVolumeTreeAsFrames(FrameInfo &volumeInfo)
Appends a tree to the root which displays one volume as heap of frames.
virtual void handleNotification(Field *field) override
Called when a parameter field is changed.
void _appendTextStyle()
Appends the Open Inventor text style setting for the entire scene graph.
void _appendVolumeList(FrameInfo &volumeListInfo)
Appends all frames of all MultiFileVolumes of the given MultiFileVolumeList volList.
void _setConvenienceDefaults()
Sets fields to values such that volumes are layouted in a way such that they can be overviewed well.
void _appendFileNameSet(FrameInfo &fileNameSetInfo)
Appends all frames of the file name set fileNameSet of volume with number volumeIndex from a number o...
void _appendVolume(FrameInfo &volumeInfo)
Appends all frames of the MultiFileVolume volume with number volumeIndex from a number of numVolumes ...
void _setUpTreeRoot()
Sets up the parent node under which all subtrees are appended.
void _appendTextAnnotationsToFrame(FrameInfo &frameInfo)
Appends the string annotations to the frame.
virtual void activateAttachments() override
Called after changes of module fields which were done without handleNotification calls.
MultiFileVolumeListDraftView()
Constructor.
void _appendVolumeShift(FrameInfo &frameInfo, size_t overrideTimePoint=0u)
Appends the Open Inventor transformations for frameInfo.tFrameIndex and possibly drawn abbreviation d...
Class managing a list of MultiFileVolume instances for the DirectDicomImport module; taking ownership...
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Field without value for notifications.
Definition: mlFields.h:1049
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
Field to encapsulate a pointer to an SoNode instance of OpenInventor.
Definition: mlFields.h:1327
Field to encapsulate a string value.
Definition: mlFields.h:1000
Class to manage a 3D set of handles describing frames or volumes to be composed to a higher dimension...
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Header of FileHandle class which should be used in DICOM importing modules to resolve the filename fo...
Provides the base class for an additional output for a MultiFileVolumeList module.
Class managing a list of MultiFileVolume instances.
Header file of class representing volumes composed of multiple DICOM or other files.
Header file of class to manage a 3D set of handles describing frames or volumes to be composed to a h...
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
const int MultiFileVolumeListDraftViewNumFiles
Number of files to be loaded.
Collects all information about a frame to be displayed .
FrameInfo(MultiFileVolumeList *volList=NULL)
Constructor with optional pointer to volumeList which is the source of the frame.
size_t numZFrames
The z-frame extent of the set of file names of the MultiFileVolume from which the frame comes which i...
size_t uFrameIndex
The u-position into set of file names of the MultiFileVolume from which the frame comes which is to b...
double oriX0
x-coordinates of the origin of the frame to be drawn.
size_t numTFrames
The t-frame extent of the set of file names of the MultiFileVolume from which the frame comes which i...
size_t volumeIndex
The index of the volume in the MultiFileVolumeList from which the MultiFileVolume-Frame comes which i...
bool allowDrawing
Decides whether the frame is displayed or not.
DCMTree::TreePtr dcmTree
The DCMTree of the frame which is to be displayed.
const ZTUFileNameSet * fileNameSet
The set of file names of the MultiFileVolume from which the frame comes which is to be displayed.
double oriZ0
z-coordinates of the origin of the frame to be drawn.
DICOMCachedIOFileHandle fileHandle
The file handle of the frame which is to be displayed.
double scaleX
x,y-, and z-scaling of the frame to be drawn.
size_t numVolumes
The number of volumes in the MultiFileVolumeList from which the MultiFileVolume-Frame comes which is ...
size_t numUFrames
The u-frame extent of the set of file names of the MultiFileVolume from which the frame comes which i...
size_t zFrameIndex
The z-position into set of file names of the MultiFileVolume from which the frame comes which is to b...
const MultiFileVolumeList * volumeList
The volume list from which the MultiFileVolume comes which the frame comes which is to be displayed.
const MultiFileVolume * volume
The pointer to the volume in the MultiFileVolumeList from which the MultiFileVolume-Frame comes which...
SoSeparator * localRoot
Inventor root node under which the entire rendering Node tress for the frame is added.
double oriY0
y-coordinates of the origin of the frame to be drawn.
double posX
x,y-, and z-position of the frame to be drawn.
SoSeparator * shapeGeometry
Inventor node under which the entire rendering shape geometry for the frame is added.
size_t tFrameIndex
The t-position into set of file names of the MultiFileVolume from which the frame comes which is to b...
SoSeparator * orientation
Inventor node under which the orientation coordinate system is appended.