CustusX  16.5.0-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::UsReconstructionFileReader Class Reference

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

#include <cxUsReconstructionFileReader.h>

Public Member Functions

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

Static Public Member Functions

static std::pair< QString,
ProbeDefinition
readProbeDefinitionFromFile (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 147 of file cxUsReconstructionFileReader.h.

Constructor & Destructor Documentation

cx::UsReconstructionFileReader::UsReconstructionFileReader ( )

Definition at line 50 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 55 of file cxUsReconstructionFileReader.cpp.

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

Definition at line 250 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 226 of file cxUsReconstructionFileReader.cpp.


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