Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoVRDicomData.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : L.Taboni (Apr 2004)
22**=======================================================================*/
23#ifndef _SO_VR_DICOM_DATA_
24#define _SO_VR_DICOM_DATA_
25
26#include <Inventor/SbLinear.h>
27#include <Inventor/SbString.h>
28#include <Inventor/SbBox.h>
29#include <Inventor/SbPImpl.h>
30
31#include <VolumeViz/readers/dicom/SiDicomDataSet.h>
32#include <VolumeViz/readers/dicom/SiDicomElement.h>
33
34SO_PIMPL_BASE_PUBLIC_DECLARATION(SoVRDicomData);
35
63{
64 SO_PIMPL_BASE_PUBLIC_HEADER(SoVRDicomData);
65public:
66
69
72
73 // header & image
74
79 SoNONUNICODE SbBool readDicomHeader (const char *fileName);
80
83 SbBool readDicomHeader (const SbString& fileName);
84
89 SoNONUNICODE SbBool readDicomImage (const char *fileName);
90
93 SbBool readDicomImage (const SbString& fileName);
94
99
100 // info from header
101
112 int getNumFrames () const;
113
115 int getImageWidth () const;
116
118 int getImageHeight () const;
119
121 int getSizeInBytes () const;
122
124 int getBytesPerPixel () const;
125
127 int getSamplesPerPixel () const;
128
131
141 void readFrame( size_t frame, const SbBox2i32& subImg, uint8_t* dst ) const;
142
150
151 // ACQUISITION info
152
158 float getSliceThicknessMM () const;
159
161 float getSliceSpacing () const;
162
163 // RELATION info
164
166 int getSeriesNumber () const;
167
169 int getImageNumber () const;
170
174 float getSliceLocation () const;
175
176 // IMAGE info
177
179 float getXPixelSize () const;
180
182 float getYPixelSize () const ;
183
193 SbBool getPosition(SbVec3f& position) const;
194
200
208 SbBool getOrientation(SbMatrix& orientation) const;
209
211 int getBitsStored () const;
212
214 int getHighBit () const;
215
217 int signedData () const;
218
220 float getIntercept () const;
221
223 float getSlope () const;
224
239 SbString getDicomInfo( unsigned short group, unsigned short element) const;
240
241private:
242 // The copying of SoVRDicomData is disabled because the copy will hold the
243 // same ImageReader, that is not a correct behavior and can cause data races.
244 SoVRDicomData( const SoVRDicomData& other );
245 SoVRDicomData& operator=( const SoVRDicomData& other );
246
248};
249
250#endif /*_SO_VR_DICOM_DATA_*/
2D box class.
Definition SbBox.h:2383
4x4 matrix class.
Definition SbMatrix.h:309
Class for smart character strings.
Definition SbString.h:202
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> DICOM data.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> DICOM data.
int getImageNumber() const
Returns the image number.
int getHighBit() const
Returns the high bit.
int getNumFrames() const
Returns the number of frames.
SbVec3f getImagePosition() const
Returns the position of the first frame's top left voxel center in the patient space.
int getBytesPerPixel() const
Returns the number of bytes per pixel.
int getBitsStored() const
Returns the number of bits stored.
float getSliceSpacing() const
Returns the slice spacing.
SoNONUNICODE SbBool readDicomImage(const char *fileName)
Reads the DICOM image.
SbBool readDicomImage(const SbString &fileName)
Reads the DICOM image.
int signedData() const
Returns the signed flag.
~SoVRDicomData()
Destructor.
float getSlope() const
Returns the slope.
SoVRDicomData()
Constructor.
int getSeriesNumber() const
Returns the series number.
SbBool supportedTransferSyntax() const
Returns true if the transfer syntax is supported by Open Inventor.
SbBool close()
Closes the underlying reader.
float getSliceThicknessMM() const
Returns the slice thickness in mm.
int getImageWidth() const
Returns the image width.
int getImageHeight() const
Returns the image height.
SoNONUNICODE SbBool readDicomHeader(const char *fileName)
Reads the DICOM file header.
int getSizeInBytes() const
Returns the image size in bytes.
float getYPixelSize() const
Returns the Y pixel size in mm.
float getSliceLocation() const
Returns the image location in mm.
float getXPixelSize() const
Returns the X pixel size in mm.
const SiDicomDataSet * getDicomDataSet() const
Returns a DICOM data object that allows accessing all the DICOM attributes.
SbBool getPosition(SbVec3f &position) const
Returns the 3D position of the center of the image.
SbString getDicomInfo(unsigned short group, unsigned short element) const
Generic method to get DICOM info.
int getSamplesPerPixel() const
Returns the number of samples per pixel.
SbBool readDicomHeader(const SbString &fileName)
Reads the DICOM file header.
SbBool getOrientation(SbMatrix &orientation) const
Returns the orientation of the DICOM volume.
float getIntercept() const
Returns the intercept.
void readFrame(size_t frame, const SbBox2i32 &subImg, uint8_t *dst) const
Read a region of a DICOM frame.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> DICOM file reader.
int SbBool
Boolean type.
Definition SbBase.h:87