Registration of an ultrasound sweep or volume to a tomographic scan (CT or MRI).
More...
Registration of an ultrasound sweep or volume to a tomographic scan (CT or MRI).
This class registers an input tomographic CT or MRI volume to an ultrasound sweep (or already compounded volume), by acting as a high-level interface for a collection of underlying alternative registration methods. According to the input, it attempts to intelligently find smart presets that lead to a robust and reliable performance.
The high-level registration algorithm is based on the following steps:
- Initialization: finds a good starting point for the registration.
- Preprocessing of the ultrasound data and the tomographic data.
- Registration: done in multiple passes, each considering a larger set of parameters.
Initialization of the registration:
- If the input is a sweep and center of the middle ultrasound frame is outside of the tomographic volume, the moving data will be translated so that the centers match.
- Depending on
p_initializationMode, the registration can be initialized using:
Preprocessing steps performed on the ultrasound data:
- If it is an UltrasoundSweep:
- Cropping of the uppermost 2.5mm from each frame (if the input has Linear geometry and no mask).
- Compounding of ultrasound sweeps into a 3D volume (if not using slice-based registration).
- If it is a volume:
- Resampling to
p_targetVolumeSpacing * p_relativeSweepSpacingPercent / 100 spacing.
Preprocessing steps performed on the tomographic data:
- Resampling so that the spacing in each dimension is at least
p_targetVolumeSpacing.
Possible similarity measures:
- 3D LC2 similarity between the compounded ultrasound volume and the tomographic volume (default mode).
- 2D LC2 similarity using the ultrasound frames to reslice the tomographic volume (if sweep is provided and
p_sliceBased is true).
The registration is done in multiple sequential passes (which can be set as Flags using setMode):
- TranslationSearch: Global translation grid search for initialization.
- LocalRigid: Local rigid (6-DoF) optimization
- LocalAffine: Local affine transformation (includes scaling and shearing)
|
| | UltrasoundRegistrationAlgorithm (SharedImageSet &ultrasoundVolumeOrSweep, SharedImageSet &tomographicVolume, const SharedImageSet *distanceVolume=nullptr) |
| | Constructor with an ultrasound sweep or volume, and the tomographic volume (MRI or CT)
|
| |
| void | setUseSegmentationWeighting (const std::string &modelPath, double maxDistance=20.0, double strength=1.0) |
| | Use a segmentation model to weight the ultrasound volume Sets p_weightingMode to Segmentation and the parameters in p_segmentationWeighting to the specified values.
|
| |
| void | setUseLandmarkWeighting (double fwhm) |
| | Use a weight volume composed of Gaussians centered around each landmark.
|
| |
| void | setLandmarkWeighting (double fwhm) |
| |
|
bool | hasLandmarks () const |
| | Whether the algorithm has landmarks available for weighting.
|
| |
|
void | setCustomWeighting (CustomWeightingFunction func) |
| | Set a custom weighting function that will be used to compute the ultrasound weight volume.
|
| |
|
std::unique_ptr< SharedImageSet > | compoundSweep () |
| | Compound a 3D volume from the ultrasound sweep.
|
| |
|
bool | prepareData () |
| | Run compounding if applicable, downsampling of both volumes, and pose initialization.
|
| |
|
Algorithm * | prepareRegAlgorithm (int pass) |
| | Create and return the internal registration algorithm instance.
|
| |
|
SweepGlobalInitAlgorithm * | globalInitAlgorithm () |
| | Return the internal global/initialization registration algorithm (creating it if required)
|
| |
| void | outputPreProcessed (DataList &dataOut) |
| | Output internal pre-processed volumes created here.
|
| |
|
OwningDataList | outputPreProcessed () |
| | Outputs internal pre-processed volumes created by this algorithm.
|
| |
|
SharedImageSet * | volume () |
| | Access to the tomographic (not ultrasound) volume.
|
| |
|
UltrasoundSweep * | sweep () |
| | Access the ultrasound sweep (may be null if only a volume was provided)
|
| |
|
ParametricDeformation * | deformation () |
| | Return pointer to the currently active deformation if available.
|
| |
| const Optimizer * | optimizer () const |
| | Access to the last used optimizer if available, in order to query statistics.
|
| |
| bool | optimizeGatingOffset () const |
| |
| void | setOptimizeGatingOffset (bool b) |
| |
| bool | inputSupportsGatingOffsetOptimization () const |
| | Returns true if both inputs are suitable for updating the GatingMetadata's phase offset, i.e.
|
| |
| | Algorithm () |
| | Default constructor will registers a single "compute" action that calls compute() and returns status().
|
| |
| virtual OwningDataList | takeOutput () |
| | Return any new Data that was created by the Algorithm during the last call to compute().
|
| |
| virtual void | setProgress (Progress *progress) |
| | Sets a Progress interface the algorithm can use to notify observers about its computing progress.
|
| |
|
Progress * | progress () const |
| | Returns the progress interface if set.
|
| |
| virtual int | status () const |
| | Indicates the status of the last call to compute().
|
| |
| virtual bool | survivesDataDeletion (const Data *) const |
| | Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list.
|
| |
| const FactoryInfo & | factoryInfo () const |
| | Returns the record describing how this Algorithm was instantiated by the AlgorithmFactory.
|
| |
|
void | setFactoryInfo (const FactoryInfo &value) |
| | Sets the record describing how this Algorithm was instantiated by the AlgorithmFactory.
|
| |
| Status | runAction (const std::string &id) |
| | Run the action with name id if it exists.
|
| |
|
const std::vector< Action > & | actions () |
| | Get a mapping from Action id to Action as registered in this algorithm.
|
| |
| virtual void | configureDefaults () |
| | Retrieve the properties of this object, replaces values with their defaults and sets it again.
|
| |
|
void | registerParameter (ParameterBase *param) |
| | Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
|
| |
|
void | unregisterParameter (const ParameterBase *param) |
| | Remove the given Parameter or SubProperty from the list of registered parameters.
|
| |
|
| Configurable (const Configurable &rhs) |
| |
|
| Configurable (Configurable &&rhs) noexcept |
| |
|
Configurable & | operator= (const Configurable &) |
| |
|
Configurable & | operator= (Configurable &&) noexcept |
| |
|
| SignalReceiver ()=default |
| | Default constructor.
|
| |
|
| SignalReceiver (const SignalReceiver &other) |
| | Copy constructor, does not copy any existing signal connections from other.
|
| |
|
SignalReceiver & | operator= (SignalReceiver rhs) |
| | Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
|
| |
|
virtual | ~SignalReceiver () |
| | Virtual destructor disconnects from all connected signals.
|
| |
|
|
Parameter< double > | p_targetVolumeSpacing = {"targetVolumeSpacing", 1.0, this} |
| | Target volume spacing of the non-ultrasound volume.
|
| |
|
Parameter< int > | p_relativeSweepSpacingPercent = {"relativeSweepSpacingPercent", 100, this} |
| | Relative spacing in percent of the ultrasound sweep wrt. the tomographic volume.
|
| |
|
Parameter< bool > | p_usIsMoving = {"usIsMoving", false, this} |
| | Specifies if the ultrasound data is moved.
|
| |
| Parameter< bool > | p_sliceBased = {"sliceBased", false, this} |
| | Use slice-to-volume registration instead of 3D-3D. Only applicable if a sweep is provided.
|
| |
|
Parameter< WeightingMode > | p_weightingMode = {"weightingMode", WeightingMode::Default, this} |
| |
|
SubProperty< LandmarkWeightingConfig > | p_landmarkWeighting = {"landmarkWeighting", LandmarkWeightingConfig(), this} |
| | Configuration for landmark weighting, used only if p_weightingMode is set to Landmarks.
|
| |
|
SubProperty< SegmentationWeightingConfig > | p_segmentationWeighting = {"segmentationWeighting", SegmentationWeightingConfig(), this} |
| | Configuration for segmentation weighting, used only if p_weightingMode is set to Segmentation.
|
| |
|
Parameter< InitializationMode > | p_initializationMode = {"initializationMode", InitializationMode::None, this} |
| | Initialization mode for the registration.
|
| |
|
Parameter< bool > | p_probeCompression = {"probeCompression", false, this} |
| | Use a probe compression deformation.
|
| |
|
Parameter< bool > | p_optimizeGatingOffset = {"optimizeGatingOffset", false, this} |
| | If true, the gating metadata phase offset will also be optimized.
|
| |
|
SubProperty< AdvancedConfig > | p_advanced = {"advanced", AdvancedConfig(), this} |
| |
|
Signal | signalOutputChanged |
| | Signal should be emitted by Algorithms when their output/result has changed.
|
| |
|
Signal | signalParametersChanged |
| | Signal should be emitted by Algorithms when their parameter configuration has changed.
|
| |
|
Signal | signalParametersChanged |
| | Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
|
| |
|
| void | setTargetVolumeSpacing (double val) |
| |
| void | setRelativeSweepSpacing (int percent) |
| | Set the desired relative spacing in percent of the ultrasound sweep wrt. the tomographic volume.
|
| |
| void | setProbeCompression (bool flag) |
| | Set whether a probe compression model should be used.
|
| |
| void | setUltrasoundIsMoving (bool flag) |
| | Set whether the ultrasound data shall be the moving one (default is false)
|
| |
| void | setGlobalInit (bool flag) |
| | Set whether deep learning based global initialization shall be attempted.
|
| |
| void | setSliceBased (bool flag) |
| | Set whether slice-based vs. volume-based registration should be used (only applicable if sweep is provided)
|
| |
| void | setDotProductSimilarity (bool flag) |
| | Set whether the deep learning based feature vector dot product similarity shall be used.
|
| |
| void | setSetMask (bool newValue) |
| | Set whether a mask should be set on the ultrasound volume to ignore zero-valued voxels during registration.
|
| |
| void | setKeepZerosDuringDownsampling (bool newValue) |
| | Whether to preserve zero-valued pixels during downsampling of the volume.
|
| |
|
void | setMode (Flags< RegistrationMode > val) |
| | Set the registration mode as bit flags with 1=global translation, 2=rigid, 3=affine.
|
| |
|
void | setExtendedSearch (double range, int steps) |
| | Enable extended search via optimizer random search, for local optimization modes.
|
| |
|
void | setErrorFunction (ErrorFunction *ef) |
| | Set an optional error function that is also used to penalize the image similarity during registration.
|
| |
|
| double | targetVolumeSpacing () const |
| |
| int | relativeSweepSpacing () const |
| | Return the relative spacing in percent of the ultrasound sweep wrt. the tomographic volume.
|
| |
| bool | setMask () |
| | Return whether a mask should be set on the ultrasound volume to ignore zero-valued voxels during registration.
|
| |
| bool | keepZerosDuringDownsampling () |
| | Whether to preserve zero-valued pixels during downsampling of the volume.
|
| |
| bool | probeCompression () const |
| | Return whether a probe compression model is used.
|
| |
| bool | ultrasoundIsMoving () const |
| | Return whether the ultrasound data is moving.
|
| |
| bool | globalInit () const |
| | Return whether global initialization is used.
|
| |
| bool | sliceBased () const |
| | Return whether slice-based registration is active.
|
| |
| bool | dotProductSimilarity () const |
| | Return whether the deep learning dot product similarity is used.
|
| |
| bool | hasDotProductSimilarity () const |
| | Return whether the deep learning dot product similarity is available.
|
| |
|
Flags< RegistrationMode > | mode () const |
| | Return the registration mode bit flags.
|
| |
| double | landmarkWeighting () const |
| | Return the current landmark weighting parameter.
|
| |
Compute the entire registration pipeline.
This method runs the entire multi-stage registration pipeline.
First, if the ultrasound input is an (image set) sweep and the registration is not slice-based, the sweep is compounded into a volume.
Then, if the registration is not slice-based, the ultrasound volume is downsampled to the specified target spacing.
As a last preparation step, if the volumes do not overlap, the registration is coarsely initialized.
Implements Algorithm.