Developer documentation
Version 3.0.3-105-gd3941f44
MR::Filter::MaskClean Class Reference

a filter to clean up masks typically output by DWIBrainMask filter More...

#include "filter/mask_clean.h"

Inheritance diagram for MR::Filter::MaskClean:
MR::Filter::Base MR::Header

Protected Member Functions

template<class InputImageType , class OutputImageType >
void single_pass (InputImageType &input, OutputImageType &output)
template<class InputImageType , class OutputImageType >
void single_scale (InputImageType &input, OutputImageType &output, const int ss)
template<class InputImageType , class OutputImageType >
bool differ (InputImageType &ima, OutputImageType &imb)
- Protected Member Functions inherited from MR::Header
void acquire_io (Header &H)
void check (const Header &H) const
void realign_transform ()
 realign transform to match RAS coordinate system as closely as possible More...
void sanitise_voxel_sizes ()
void sanitise_transform ()
void sanitise_strides ()

Protected Attributes

unsigned int scale
- Protected Attributes inherited from MR::Filter::Base
std::string message
- Protected Attributes inherited from MR::Header
vector< Axis > axes_
transform_type transform_
std::string name_
KeyValues keyval_
const char * format_
std::unique_ptr< ImageIO::Baseio
 additional information relevant for images stored on file More...
DataType datatype_
 the type of the data as stored on file More...
default_type offset_
 the values by which to scale the intensities More...
default_type scale_
std::array< size_t, 3 > realign_perm_
std::array< bool, 3 > realign_flip_

Detailed Description

a filter to clean up masks typically output by DWIBrainMask filter

Removes peninsula-like extensions of binary masks, where the peninsula itself is wider than the bridge connecting it to the mask. Typical examples are eyes connected to the mask by parts of the optical nerves; or other non-brain parts or artefacts.

Typical usage:

auto input = Image<bool>::open (argument[0]);
Filter::MaskClean mask_clean_filter (input);
auto output = Image<bool>::create (argument[1], mask_clean_filter);
mask_clean_filter (input, output);
static Image create(const std::string &image_name, const Header &template_header, bool add_to_command_history=true)
Definition: image.h:192
static Image open(const std::string &image_name, bool read_write_if_existing=false)
Definition: image.h:189
vector< ParsedArgument > argument
the list of arguments parsed from the command-line

Definition at line 56 of file mask_clean.h.

Member Function Documentation

◆ differ()

template<class InputImageType , class OutputImageType >
bool MR::Filter::MaskClean::differ ( InputImageType &  ima,
OutputImageType &  imb 

Definition at line 173 of file mask_clean.h.

◆ single_pass()

template<class InputImageType , class OutputImageType >
void MR::Filter::MaskClean::single_pass ( InputImageType &  input,
OutputImageType &  output 

Definition at line 126 of file mask_clean.h.

◆ single_scale()

template<class InputImageType , class OutputImageType >
void MR::Filter::MaskClean::single_scale ( InputImageType &  input,
OutputImageType &  output,
const int  ss 

Definition at line 145 of file mask_clean.h.

Member Data Documentation

◆ scale

unsigned int MR::Filter::MaskClean::scale

Definition at line 182 of file mask_clean.h.

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