UsTK : Ultrasound ToolKit
version 2.0.1 under development (2024-11-21)
|
#include <visp3/ustk_core/usMHDSequenceReader.h>
Public Member Functions | |
usMHDSequenceReader () | |
~usMHDSequenceReader () | |
void | acquire (usImageRF2D< short int > &image, uint64_t ×tamp) |
void | acquire (usImagePreScan2D< unsigned char > &image, uint64_t ×tamp) |
void | acquire (usImagePostScan2D< unsigned char > &image, uint64_t ×tamp) |
void | acquire (usImageRF3D< short int > &image, std::vector< uint64_t > ×tamp) |
void | acquire (usImagePreScan3D< unsigned char > &image, std::vector< uint64_t > ×tamp) |
void | acquire (usImagePostScan3D< unsigned char > &image, uint64_t ×tamp) |
bool | end () |
void | getImage (unsigned int imageNumber, usImageRF2D< short int > &image, uint64_t ×tamp) |
void | getImage (unsigned int imageNumber, usImagePreScan2D< unsigned char > &image, uint64_t ×tamp) |
void | getImage (unsigned int imageNumber, usImagePostScan2D< unsigned char > &image, uint64_t ×tamp) |
void | getImage (unsigned int imageNumber, usImageRF3D< short int > &image, std::vector< uint64_t > ×tamp) |
void | getImage (unsigned int imageNumber, usImagePreScan3D< unsigned char > &image, std::vector< uint64_t > ×tamp) |
void | getImage (unsigned int imageNumber, usImagePostScan3D< unsigned char > &image, uint64_t ×tamp) |
us::ImageType | getImageType () const |
int | getImageNumber () const |
uint64_t | getNextTimeStamp () |
std::vector< uint64_t > | getNextTimeStamps () |
int | getTotalImageNumber () const |
void | setSequenceDirectory (const std::string sequenceDirectory) |
Reader for a sequence of images stored as mhd/raw files in a directory Image sequence files order have to respect alphabetical order in the directory, and be the same for corresponding mhd and raw files. For example : image1.mhd, image1.raw, image2.mhd, image2.raw, ... The directory must contain exactly the same number of images as the number of images contained in the sequence (1 mhd file and 1 raw file per image of the sequence).
Here is an example code of a basic use of this class:
Definition at line 100 of file usMHDSequenceReader.h.
usMHDSequenceReader::usMHDSequenceReader | ( | ) |
Constructor, initializes the member attribues.
Definition at line 6 of file usMHDSequenceReader.cpp.
usMHDSequenceReader::~usMHDSequenceReader | ( | ) |
Destructor.
Definition at line 14 of file usMHDSequenceReader.cpp.
void usMHDSequenceReader::acquire | ( | usImagePostScan2D< unsigned char > & | image, |
uint64_t & | timestamp | ||
) |
Acquisition method for usImagePostScan2D : fills the output image with the next image in the sequence.
[out] | image | The usImagePostScan2D image acquired. |
[out] | timestamp | The timestamp of the image (0 if not present in the sequence parameters). |
Definition at line 130 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImageIo::getHeaderFormat(), us::NOT_SET, us::POSTSCAN_2D, usTransducerSettings::setDepth(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), usTransducerSettings::setTransmitFrequency(), and usImagePostScan2D< Type >::setWidthResolution().
void usMHDSequenceReader::acquire | ( | usImagePostScan3D< unsigned char > & | image, |
uint64_t & | timestamp | ||
) |
Acquisition method for usImagePostScan3D : fills the output image with the next volume in the sequence.
[out] | image | The usImagePostScan3D image acquired. |
[out] | timestamp | The usImagePostScan3D timestamp (0 if not present in mhd file). |
Definition at line 310 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImageIo::getHeaderFormat(), us::NOT_SET, us::POSTSCAN_3D, usImage3D< Type >::resize(), usImagePostScan3D< Type >::setElementSpacingX(), usImagePostScan3D< Type >::setElementSpacingY(), usImagePostScan3D< Type >::setElementSpacingZ(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLineNumber(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::acquire | ( | usImagePreScan2D< unsigned char > & | image, |
uint64_t & | timestamp | ||
) |
Acquisition method for usImagePreScan2D : fills the output image with the next image in the sequence.
[out] | image | The usImagePreScan2D image acquired. |
[out] | timestamp | The timestamp of the image (0 if not present in the sequence parameters). |
Definition at line 82 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, us::PRESCAN_2D, usImagePreScan2D< Type >::resize(), usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usImagePreScanSettings::setImagePreScanSettings(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::acquire | ( | usImagePreScan3D< unsigned char > & | image, |
std::vector< uint64_t > & | timestamp | ||
) |
Acquisition method for usImagePreScan3D : fills the output image with the next volume in the sequence.
[out] | image | The usImagePreScan3D image acquired. |
[out] | timestamp | The timestamps of the image (0 if not present in the sequence parameters). Every frame of the volume contains an associated timesamp. If the volume number in the sequence is odd, the timestamp vector is reversed : to fit the real conditions of the sweeping motor of a 3D probe (along + / - Z axis every new volume). First volume of a sequence is considered going along Z axis, and the second along -Z, etc... |
Definition at line 253 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, us::PRESCAN_3D, usImagePreScan3D< Type >::resize(), usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usImagePreScanSettings::setImagePreScanSettings(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorSettings(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::acquire | ( | usImageRF2D< short int > & | image, |
uint64_t & | timestamp | ||
) |
Acquisition method for usImageRF2D : fills the output image with the next image in the sequence.
[out] | image | The usImageRF2D image acquired. |
[out] | timestamp | The timestamp of the image (0 if not present in the sequence parameters). |
Definition at line 33 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, usImageRF2D< Type >::resize(), us::RF_2D, usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usImagePreScanSettings::setImagePreScanSettings(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::acquire | ( | usImageRF3D< short int > & | image, |
std::vector< uint64_t > & | timestamp | ||
) |
Acquisition method for usImageRF3D : fills the output image with the next volume in the sequence.
[out] | image | The usImageRF3D image acquired. |
[out] | timestamp | The timestamps of the image (0 if not present in the sequence parameters). Every frame of the volume contains an associated timesamp. If the volume number in the sequence is odd, the timestamp vector is reversed : to fit the real conditions of the sweeping motor of a 3D probe (along + / - Z axis every new volume). First volume of a sequence is considered going along Z axis, and the second along -Z, etc... |
Definition at line 192 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, usImageRF3D< Type >::resize(), us::RF_3D, usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usImagePreScanSettings::setImagePreScanSettings(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorSettings(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
bool usMHDSequenceReader::end | ( | ) |
Tells the used if the end of the sequence is reached.
Definition at line 363 of file usMHDSequenceReader.cpp.
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImagePostScan2D< unsigned char > & | image, | ||
uint64_t & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImagePostScan2D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImagePostScan2D image acquired. |
[out] | timestamp | The usImagePostScan2D timestamp (0 if not present in mhd file). |
Definition at line 515 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImageIo::getHeaderFormat(), us::NOT_SET, us::POSTSCAN_2D, usTransducerSettings::setDepth(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), usTransducerSettings::setTransmitFrequency(), and usImagePostScan2D< Type >::setWidthResolution().
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImagePostScan3D< unsigned char > & | image, | ||
uint64_t & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImagePostScan3D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImagePostScan3D image acquired. |
[out] | timestamp | The usImagePostScan3D timestamp (0 if not present in mhd file). |
Definition at line 687 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImageIo::getHeaderFormat(), us::NOT_SET, us::POSTSCAN_3D, usImage3D< Type >::resize(), usImagePostScan3D< Type >::setElementSpacingX(), usImagePostScan3D< Type >::setElementSpacingY(), usImagePostScan3D< Type >::setElementSpacingZ(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLineNumber(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImagePreScan2D< unsigned char > & | image, | ||
uint64_t & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImagePreScan2D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImagePreScan2D image acquired. |
[out] | timestamp | The usImagePreScan2D timestamp (0 if not present in mhd file). |
Definition at line 466 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, us::PRESCAN_2D, usImagePreScan2D< Type >::resize(), usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usImagePreScanSettings::setImagePreScanSettings(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImagePreScan3D< unsigned char > & | image, | ||
std::vector< uint64_t > & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImagePreScan3D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImagePreScan3D image acquired. |
[out] | timestamp | The usImagePreScan3D timestamp (0 if not present in mhd file). |
Definition at line 630 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, us::PRESCAN_3D, usImagePreScan3D< Type >::resize(), usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usImagePreScanSettings::setImagePreScanSettings(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorSettings(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImageRF2D< short int > & | image, | ||
uint64_t & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImageRF2D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImageRF2D image acquired. |
[out] | timestamp | The usImageRF2D timestamp (0 if not present in mhd file). |
Definition at line 417 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, usImageRF2D< Type >::resize(), us::RF_2D, usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usImagePreScanSettings::setImagePreScanSettings(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
void usMHDSequenceReader::getImage | ( | unsigned int | imageNumber, |
usImageRF3D< short int > & | image, | ||
std::vector< uint64_t > & | timestamp | ||
) |
Acquisition method for specific image in the sequence for usImageRF3D : fills the output image with the next volume in the sequence.
[in] | imageNumber | Image number in sequence to acquire (from 0 to total image number - 1) |
[out] | image | The usImageRF3D image acquired. |
[out] | timestamp | The usImageRF3D timestamp (0 if not present in mhd file). |
Definition at line 573 of file usMHDSequenceReader.cpp.
References usImageIo::FORMAT_MHD, usImagePreScanSettings::getAxialResolution(), usImageIo::getHeaderFormat(), us::NOT_SET, usImageRF3D< Type >::resize(), us::RF_3D, usImagePreScanSettings::setAxialResolution(), usTransducerSettings::setDepth(), usMotorSettings::setFrameNumber(), usMotorSettings::setFramePitch(), usImagePreScanSettings::setImagePreScanSettings(), usMotorSettings::setMotorRadius(), usMotorSettings::setMotorSettings(), usMotorSettings::setMotorType(), usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().
int usMHDSequenceReader::getImageNumber | ( | ) | const |
Returns the current image number, of last image acquired.
Definition at line 402 of file usMHDSequenceReader.cpp.
us::ImageType usMHDSequenceReader::getImageType | ( | ) | const |
Returns the current type of image acquired.
Definition at line 369 of file usMHDSequenceReader.cpp.
uint64_t usMHDSequenceReader::getNextTimeStamp | ( | ) |
Returns the timestamp of next frame (use only for 2D sequence).
Definition at line 375 of file usMHDSequenceReader.cpp.
std::vector< uint64_t > usMHDSequenceReader::getNextTimeStamps | ( | ) |
Returns the timestamps of next volume.
Definition at line 387 of file usMHDSequenceReader.cpp.
int usMHDSequenceReader::getTotalImageNumber | ( | ) | const |
Returns the total image number in sequence.
Definition at line 408 of file usMHDSequenceReader.cpp.
void usMHDSequenceReader::setSequenceDirectory | ( | const std::string | sequenceDirectory | ) |
Setter for the directory containing the mhd sequence to read. To call before calling acquire !
sequenceDirectory | The directory path. |
Definition at line 20 of file usMHDSequenceReader.cpp.