Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cx::UsReconstructionFileReader Class Reference

Reader class for the US Acquisition files. More...

#include <cxUsReconstructionFileReader.h>

Public Member Functions

 UsReconstructionFileReader (FileManagerServicePtr fileManager)
 
USReconstructInputData readAllFiles (QString fileName, QString calFilesPath="")
 
std::vector< TimedPositionreadFrameTimestamps (QString fileName)
 

Static Public Member Functions

static std::pair< QString, ProbeDefinitionreadProbeDefinitionFromFile (QString mhdFileName)
 

Detailed Description

Reader class for the US Acquisition files.

See also
UsReconstructionFileMaker

Format description

All files describing one acquisition lie the same folder. The files all have the name format US-Acq_<index>_<TS><stream>.<type>", where

  • <index> is a running index, for convenience.
  • <TS> is a timestamp
  • <stream> is the uid of the video stream. Not used prior to cx3.5.0.
  • <type> is the format of that specific file.

Together, the files contains information about the us images and their timestamps, the tracking positions and their timestamps, and the probe calibration.

In the following, we use <filebase> = US-Acq_<index>_<TS><stream>.

<filebase>.mhd (obsolete)

Used prior to version cx3.4.0. A file in the metaheader file format containing the uncompressed image data. the z-direction is the time axis, i.e. the z dim is the number of us frames. See http://www.itk.org/Wiki/MetaIO/Documentation for more.

Two extra tags are added:

ConfigurationID = <path:inside:ProbeCalibConfigs.xml>
ProbeCalibration = <not used>

The ConfigurationID refers to a specific configuration within ProbeCalibConfigs.xml, using colon separators.

<filebase>_<index>.mhd

A sequence of files in the metaheader file format containing the image data, one file for each frame. The frame index is given by the index in the file name. See http://www.itk.org/Wiki/MetaIO/Documentation for more. Replaces ref us_acq_file_format_mhd .

ProbeCalibConfigs.xml (obsolete)

This file contains the probe definition, and is copied from the config/tool/Tools folder.

<filebase>.probedata.xml

This file contains the probe definition. Replaces ref us_acq_file_format_file_xml .

<filebase>.fts

This file contains the frame timestamps. This is a sequence of newline-separated floating-point numbers in milliceconds. The starting point is irrelevant. The number of timestamps must equal the number of us frames.

<filebase>.tp

This file contains the tracking positions. This is a newline-separated sequence of matrices, one for each tracking sample. Each matrix is the prMt, i.e. the transform from tool to patient reference (See Coordinate Systems ). The last line of the matrix (always containing 0 0 0 1) is omitted. The matrix numbers is whitespace-separated with newline between rows. Thus the number of lines in this file is (# tracking positions) x 3.

<filebase>.tts

This file contains the tracking timestamps. The format equals <filebase>.fts , but the number of timestamps equals the number of tracking positions.

<filebase>.fp

This file contains the frame positions. This is a newline-separated sequence of matrices, one for each US frame. Each matrix is the rMu, i.e. the transform from lower-left centered image space to global reference (See Coordinate Systems and ProbeDefinition). The last line of the matrix (always containing 0 0 0 1) is omitted. The matrix numbers is whitespace-separated with newline between rows. Thus the number of lines in this file is (# tracking positions) x 3.

<filebase>.mask.mhd

This file contains the image mask. The binary image shows what parts of the frame images contain valid US data. This file is only written, not read. It can be constructed from the probe data.

Definition at line 126 of file cxUsReconstructionFileReader.h.

Constructor & Destructor Documentation

cx::UsReconstructionFileReader::UsReconstructionFileReader ( FileManagerServicePtr  fileManager)

Definition at line 29 of file cxUsReconstructionFileReader.cpp.

Member Function Documentation

USReconstructInputData cx::UsReconstructionFileReader::readAllFiles ( QString  fileName,
QString  calFilesPath = "" 
)

Read all data from the files and return as a FileData object.

NOTE: The mFrames var will not be initialized with transforms, they must be generated explicitly.

the mMask var is filled with data from ProbeDefinition, or from file if present.

Definition at line 35 of file cxUsReconstructionFileReader.cpp.

std::vector< TimedPosition > cx::UsReconstructionFileReader::readFrameTimestamps ( QString  fileName)

Definition at line 230 of file cxUsReconstructionFileReader.cpp.

std::pair< QString, ProbeDefinition > cx::UsReconstructionFileReader::readProbeDefinitionFromFile ( QString  mhdFileName)
static

Read probe data from the probedata config file attached to the mhd file, named <mhdfilename-base>.probedata.xml

Definition at line 206 of file cxUsReconstructionFileReader.cpp.


The documentation for this class was generated from the following files: