16#ifndef _INVENTOR_MEDICAL_HELPER_H_
17#define _INVENTOR_MEDICAL_HELPER_H_
28#if defined(__DIALOGVIZLIB)
35#include <Inventor/STL/vector>
205 const SoVolumeData* volume = NULL,
float slack = 1.01 );
600 template <
typename NodeType>
608 if (!nodeName.isEmpty())
618 spa->
setType(NodeType::getClassTypeId());
630 std::cerr <<
"Cannot find \"" << nodeName <<
"\" of type \"" << NodeType::getClassTypeId().
getName() <<
"\" in scene graph." << std::endl;
634 NodeType* node =
dynamic_cast<NodeType*
>(spa->
getPath()->
getTail());
639 std::cerr <<
"Cannot find \"" << nodeName <<
"\" of type \"" << NodeType::getClassTypeId().
getName() <<
"\" in scene graph." << std::endl;
650 template <
typename NodeType>
654 sa->
setType(NodeType::getClassTypeId());
661 std::vector<NodeType*> ret;
666 std::cerr << NodeType::getClassTypeId().getName().getString() <<
" not found" << std::endl;
670 for (
int i = 0; i < path.
getLength(); i++)
671 ret.push_back(
dynamic_cast<NodeType*
>(path[i]->getTail()));
678#if defined(__DIALOGVIZLIB)
685 template <
typename NodeType>
695 std::cerr <<
"Cannot find " << auditorId <<
" of type " << NodeType::getClassTypeId().getName() <<
" in interface." << std::endl;
725#if defined(__DIALOGVIZLIB)
732 template<
typename W
idgetType>
734 buildInterface(WidgetType window,
const char* filename,
const char* viewerName,
SoTopLevelDialog** topLevelDialog)
749 (*topLevelDialog)->buildDialog(window, customNode != NULL);
750 (*topLevelDialog)->show();
752 return customNode ? customNode->
getWidget() : window;
#define TRUE
Possible value of SbBool.
#define FALSE
Possible value of SbBool.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> (Preview feature...
static Axis MedicalAxisFromViewAxis(openinventor::inventor::Axis::Type viewAxis, const SoVolumeData *volData)
Returns the medical axis (AXIAL, CORONAL, SAGITTAL) corresponding to the specified view axis (X,...
static SoNode * exampleLogoNode()
Returns a logo image node for Open Inventor medical examples.
static SoSeparator * buildSliceOrientationMarkers(const SoOrthoSlice *orthoSlice)
Build a scene graph to display slice orientation markers.
static SbBool dicomGetWindowCenterWidth(const SoVolumeData *volume, SbVec2f &winCW)
Get the window center (level) and width values from a DICOM volume.
static SoSeparator * readFile(const char *filename)
Convenience function to read a .iv file and return pointer to the root of the created scenegraph.
static Axis MedicalAxisFromViewAxis(openinventor::inventor::Axis::Type viewAxis, const SbMatrix &orientationMatrix)
Returns the medical axis (AXIAL, CORONAL, SAGITTAL) corresponding to the specified view axis (X,...
static int dicomFindFilesbySeries(const SbString &firstFile, std::vector< SbString > &files)
Get files in DICOM series.
SbVec3f getDicomOrigin(const SoVolumeData *volume) const
Returns the DICOM volume origin in 3D space.
static NodeType * find(SoNode *root, const SbString &nodeName=SbString(), const bool okIfNotFound=false)
Convenience function to find first specified node in specified scene graph.
static openinventor::inventor::Axis::Type ViewAxisFromMedicalAxis(Axis medicalAxis, const SoVolumeData *volData)
Returns the view axis (X, Y, Z) corresponding to the specified medical axis (AXIAL,...
static SbBool dicomAdjustVolume(SoVolumeData *volume, SbBool useImagePosition=TRUE)
Optimize volume data node for DICOM volumes.
static int dicomFindFilesbySeries(const SbString &firstFile, SbStringList &files)
Get files in DICOM series.
static SoVolumeData * getVolumeData(const SoImageDataAdapter *adapter)
Make an ImageViz data set available in VolumeViz.
static SbBool orientView(MedicalHelper::Axis axis, SoCamera *camera, const SoVolumeData *volume=NULL, float slack=1.01)
Orient view.
static SoNode * exampleDicomAnnotation(const SbString &filename)
Returns a collection of DicomInfo annotation nodes for Open Inventor medical examples.
static SbBool dicomCheckMonochrome1(SoTransferFunction *cmapNode, const SoVolumeData *volume, SbBool forceReverse=FALSE)
Automatically adjusts the color map (transferFunction) if the specified volume is a DICOM data set (r...
static void dollyZoom(float value, SoCamera *camera)
Make the scene appear larger or smaller.
static SbBool setFilenameList(SoVRDicomFileReader &reader, const std::vector< SbString > &list)
Set filename list using a list of strings (file names).
static SoSeparator * createCube(const SbBox3f &bbox)
Convenience function to draw a cube representing the specified bounding box.
static std::vector< NodeType * > findNodes(SoNode *scene)
Convenience function to find all node of specified type in specified graph.
static SbBool dicomSetWindowCenterWidth(SoDataRange *dataRange, const SbVec2f &winCW)
Set an SoDataRange node from the window center (level) and width values.
SbVec3f getVoxelSize(const SoVolumeData *volume) const
Returns the voxel size in 3D space.
static SoSeparator * createBoundingBox(const SbBox3f &bbox, SbColor *color=NULL)
Convenience function to draw a wireframe box representing the specified bounding box.
static const SbVec2s & exampleWindowSize()
Returns standard window size for Open Inventor medical examples.
static openinventor::inventor::Axis::Type ViewAxisFromMedicalAxis(Axis medicalAxis, const SbMatrix &orientationMatrix)
Returns the view axis (X, Y, Z) corresponding to the specified medical axis (AXIAL,...
static SbBool dicomGetImagePosition(const SoVolumeData *volume, SbVec3f &imagePos)
Get the "Image Position (Patient)" attribute (0020,0032) from a DICOM volume.
static SoSeparator * buildSliceAnnotation(const SoCamera *camera, const SoOrthoSlice *sliceNode, const SbString *dicomFilename)
Slice viewer annotations.
static SoSeparator * buildSliceScaleBars(const SoCamera *camera)
Build a scene graph to display dynamic scale bars for slice viewing.
static SbBool dicomAdjustDataRange(SoDataRange *rangeNode, const SoVolumeData *volume)
Adjust data range based on values in the DICOM file, i.e.
static SbVec2f dicomGetWindowCenterWidth(const SoDataRange *dataRange)
Get the window center (level) and width values from an SoDataRange node.
static SbBool dicomAdjustVolume(SoVolumeData *volume, SoMatrixTransform *imgToPatient)
Similar to dicomAdjustVolume( SoVolumeData*, SbBool ) above but returns an SoMatrixTransform that can...
SbVec3f getPhysicalSize(const SoVolumeData *volume) const
Returns the volume's physical size in 3D space.
static SbBox3f getBoundingBox(SoNode *node)
Convenience function to retrieve bounding box of specified node.
static SoMemoryDataAdapter * getImageDataAdapter(const SoVolumeData *volume)
Make a VolumeViz data set available in ImageViz.
int getLength() const
Returns number of pointers in list.
Class for smart character strings.
Maintains a list of pointers to SbString instances.
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
Abstract base class for camera nodes.
static SoSeparator * readAll(SoInput *in)
Reads all graphs and paths from the file specified by the given SoInput.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Range of...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog Custom no...
SoWidget getWidget()
Returns the custom base widget.
Base class for all group nodes.
virtual SoNode * getChild(int index) const
Returns pointer the child node with the given index.
<a href="IconLegend.html"><img src="extIP.gif" alt="ImageViz" border="0"></a> Abstract base class fo...
<a href="IconLegend.html"><img src="extIP.gif" alt="ImageViz" border="0"></a> Image data adapter for...
Abstract base class for all database nodes.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Ortho slice shape nod...
SoNode * getTail() const
Returns the last node in a path chain.
Maintains a list of pointers to paths.
void unrefNoDelete() const
unrefNoDelete() should be called when it is desired to decrement the reference count,...
void ref() const
Adds a reference to an instance.
Searches for nodes in a scene graph.
void setType(SoType t, SbBool derivedIsOk=TRUE)
Sets the node type to search for.
@ ALL
Return all paths found.
SoPathList & getPaths()
Returns resulting path list.
SoPath * getPath() const
Returns resulting path, or NULL if no path was found.
const SbName & getName() const
Returns the name of the node to search for.
void setInterest(Interest i)
Sets which paths to return.
void setSearchingAll(SbBool flag)
Sets whether searching uses regular traversal or whether it traverses every single node.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Searches for a n...
void setSearchString(const char *searchString)
Sets the search path string.
Group node that saves and restores traversal state.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Top Level Dialog...
SoDialogViz * searchForAuditorId(SbString id)
Retrieves the DialogViz object from the specified auditorID field in an SoTopLevelDialog structure.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Describe...
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> DICOM file reader.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Volume data property ...
Type
Specification of either an X, a Y or a Z axis.
#define INVENTORMEDICAL_API