brainrat-private  5.1.2
slices.h File Reference
#include <iomanip>
#include <cartobase/type/string_conversion.h>
#include <aims/io/process.h>
#include <aims/io/io_g.h>
#include <aims/data/data_g.h>
#include <aims/math/mathelem.h>
#include <aims/morphology/morphology_g.h>
#include <aims/utility/converter_g.h>
Include dependency graph for slices.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SlicesDetector
 
class  SlicesStacker
 
class  RGBSlicesStacker
 
class  GreyLevelSlicesStacker
 
struct  Component
 
struct  Tests
 
struct  Maxima
 
class  HistologyScanSlicesDetector
 

Macros

#define INCH   25.49
 
#define NB_MODES   2
 
#define MIN_HISTO   0
 
#define MAX_HISTO   64
 
#define MAX_INT16_T   32767
 
#define MAX_ITER   500
 
#define MID_WINDOW   4
 
#define FRACTION   3.0
 
#define BORDER_LOCAL   10
 
#define BORDER_GLOBAL   50
 
#define PERCENT_SURFACE   .2
 
#define EROSION   1
 

Typedefs

typedef struct ComponentComponentPtr
 
typedef struct TestsTestsPtr
 
typedef struct MaximaMaximaPtr
 
typedef std::vector< Component >::iterator CompIterator
 
typedef std::vector< Maxima >::iterator MaxIterator
 

Enumerations

enum  ContinuityParameterTested { ComponentSurface , ComponentSize_hz , ComponentSize_vt }
 
enum  Direction { Horizontal , Vertical }
 
enum  HistoAnalysisFunction { HistogramMode , ProjectionMode }
 

Functions

Maxima affectMaxima (int32_t iter, int32_t num, int32_t val, int32_t pos, int32_t extr)
 
void writeComponents (std::vector< Component > &comp)
 
void writeVector3int32_t (std::vector< AimsVector< int32_t, 3 > > &vect)
 
void writeVectorInt32_t (std::vector< int32_t > &vect)
 
void writeAimsInt32_t (carto::VolumeRef< int32_t > &vol)
 
void writeAimsFloat (carto::VolumeRef< float > &vol)
 
void writeMaxima (std::vector< Maxima > &mxm)
 
void writeMaximaIter (std::vector< Maxima > &mxm, int32_t iter)
 
template<class T >
float computeHistogramRatio (const carto::VolumeRef< T > &vol, const int32_t bins)
 
carto::VolumeRef< int32_t > generateHistogram (const carto::VolumeRef< int16_t > &vol, const int32_t bins=MAX_HISTO)
 
std::vector< AimsVector< int32_t, 3 > > updateVDM (std::vector< AimsVector< int32_t, 3 > > &vdm)
 
carto::VolumeRef< int16_t > applyThreshold (const carto::VolumeRef< int16_t > &vol, const int16_t threshold_lower_bound, const int16_t threshold_upper_bound, const int16_t new_value=MAX_INT16_T)
 
carto::VolumeRef< int16_t > computeConnexComponent (carto::VolumeRef< int16_t > &vol)
 
std::vector< ComponentremoveComponent (std::vector< Component > cpnt, int32_t l)
 
std::vector< ComponentremoveComponents (const std::vector< Component > &cpnt, const std::vector< Component > &to_remove)
 
std::vector< ComponentinsertComponent (std::vector< Component > cpnt, int32_t comp, std::vector< Component > cpnt2slices, int32_t l)
 
std::vector< int32_t > getComponentLabels (const std::vector< Component > &cpnt)
 
std::vector< ComponentextractInformationFromComponent (const carto::VolumeRef< int16_t > &vol)
 
Tests testComponents (const std::vector< Component > &cpnt, int32_t number_cpnt)
 
void displayComponentsStrategy (const std::vector< Component > &cpnt)
 
void displayStatus (const Tests &t)
 
bool isValid (const Tests &t)
 
std::vector< int32_t > extractVectorFromComponent (std::vector< Component > cpnt, ContinuityParameterTested param)
 
std::vector< ComponentprocessMedianConsistencyParameters (std::vector< Component > &cpnt, float variation, int32_t mid_window=0)
 
carto::VolumeRef< int32_t > projectData (carto::VolumeRef< int16_t > &X)
 
carto::VolumeRef< int16_t > transposeVolume (carto::VolumeRef< int16_t > &vol)
 
bool removeComponentsInVolume (carto::VolumeRef< int16_t > &vol, const std::vector< Component > &to_remove)
 
carto::VolumeRef< int16_t > extractFromVolume (const carto::VolumeRef< int16_t > &vol, const int32_t x, const int32_t X, const int32_t y, const int32_t Y, const int32_t old_label, const int32_t new_label)
 
bool copyToVolume (const carto::VolumeRef< int16_t > &vol, carto::VolumeRef< int16_t > &destvol, const int32_t x, const int32_t X, const int32_t y, const int32_t Y, const int32_t old_label, const int32_t new_label)
 
std::vector< ComponentopeningComponent (std::vector< Component > &cpnt, int32_t comp, carto::VolumeRef< int16_t > vol, float fraction)
 
std::vector< ComponentseparateComponent (std::vector< Component > &cpnt, int32_t comp, carto::VolumeRef< int16_t > vol, int32_t min_surface, Direction dir, float fraction)
 
std::vector< ComponentgetOutliersBySurface (const std::vector< Component > &cpnt, const float min_surface)
 
std::vector< ComponentgetOutliersByWeight (const std::vector< Component > &cpnt, const int32_t slices_number)
 
std::vector< ComponentfilterComponentsBySurface (const std::vector< Component > &cpnt, const float min_surface)
 
std::vector< ComponentweightedRemoveComponents (std::vector< Component > &cpnt, int32_t slices_number)
 
std::vector< ComponentprocessOutlierComponent (std::vector< Component > &cpnt, carto::VolumeRef< int16_t > &vol, int32_t min_surface, int32_t slices_number, float fraction)
 
int32_t getDimensionCount (std::vector< int32_t > dimensionsizes)
 
std::vector< ComponentchangeComponentsIndex (std::vector< Component > &components, std::vector< int32_t > dimensionsizes, std::vector< int32_t > dimensionorders, int32_t offset=1, int32_t step=1)
 
bool compareComponentsByLabelM (const Component &c1, const Component &c2)
 
std::vector< ComponentsortComponent (std::vector< Component > &cpnt, std::vector< int32_t > dimensionsizes)
 
carto::VolumeRef< int16_t > applyNewLabelling (std::vector< Component > cpnt, carto::VolumeRef< int16_t > vol)
 
template<class T >
bool detectSlices (aims::Process &p, const std::string &, aims::Finder &)
 
int32_t extractMaxima (std::vector< int32_t > vctr)
 
template<class T >
void rescale (carto::VolumeRef< T > &in, carto::RescalerInfo &info)
 
template<class T >
bool writeStackedSlices (int32_t dx, int32_t dy, int32_t res, float z, T background, std::vector< Component > &cpnt, carto::VolumeRef< T > &vol, std::string outputfile, std::string format)
 
template<class T >
bool writeNumberedSlices (int32_t dx, int32_t dy, int32_t res, float z, T background, std::vector< Component > &cpnt, carto::VolumeRef< T > &vol, std::string outputdir, std::string outputname, std::string format, uint8_t slicemin)
 
template<class T >
float getVoxelLebesgue (const carto::VolumeRef< T > &vol)
 
template<class T >
int32_t getVoxelCount (const carto::VolumeRef< T > &vol, float value)
 
template<class T >
background (std::vector< Component > &cpnt, carto::VolumeRef< T > &vol)
 
template<>
AimsRGB background< AimsRGB > (std::vector< Component > &cpnt, carto::VolumeRef< AimsRGB > &vol)
 
template<>
AimsRGBA background< AimsRGBA > (std::vector< Component > &cpnt, carto::VolumeRef< AimsRGBA > &vol)
 

Macro Definition Documentation

◆ BORDER_GLOBAL

#define BORDER_GLOBAL   50

Definition at line 34 of file slices.h.

◆ BORDER_LOCAL

#define BORDER_LOCAL   10

Definition at line 33 of file slices.h.

◆ EROSION

#define EROSION   1

Definition at line 36 of file slices.h.

◆ FRACTION

#define FRACTION   3.0

Definition at line 31 of file slices.h.

◆ INCH

#define INCH   25.49

Definition at line 23 of file slices.h.

◆ MAX_HISTO

#define MAX_HISTO   64

Definition at line 26 of file slices.h.

◆ MAX_INT16_T

#define MAX_INT16_T   32767

Definition at line 27 of file slices.h.

◆ MAX_ITER

#define MAX_ITER   500

Definition at line 28 of file slices.h.

◆ MID_WINDOW

#define MID_WINDOW   4

Definition at line 29 of file slices.h.

◆ MIN_HISTO

#define MIN_HISTO   0

Definition at line 25 of file slices.h.

◆ NB_MODES

#define NB_MODES   2

Definition at line 24 of file slices.h.

◆ PERCENT_SURFACE

#define PERCENT_SURFACE   .2

Definition at line 35 of file slices.h.

Typedef Documentation

◆ CompIterator

typedef std::vector<Component>::iterator CompIterator

Definition at line 265 of file slices.h.

◆ ComponentPtr

typedef struct Component * ComponentPtr

◆ MaximaPtr

typedef struct Maxima * MaximaPtr

◆ MaxIterator

typedef std::vector<Maxima>::iterator MaxIterator

Definition at line 266 of file slices.h.

◆ TestsPtr

typedef struct Tests * TestsPtr

Enumeration Type Documentation

◆ ContinuityParameterTested

Enumerator
ComponentSurface 
ComponentSize_hz 
ComponentSize_vt 

Definition at line 93 of file slices.h.

◆ Direction

enum Direction
Enumerator
Horizontal 
Vertical 

Definition at line 100 of file slices.h.

◆ HistoAnalysisFunction

Enumerator
HistogramMode 
ProjectionMode 

Definition at line 106 of file slices.h.

Function Documentation

◆ affectMaxima()

Maxima affectMaxima ( int32_t  iter,
int32_t  num,
int32_t  val,
int32_t  pos,
int32_t  extr 
)

◆ applyNewLabelling()

carto::VolumeRef<int16_t> applyNewLabelling ( std::vector< Component cpnt,
carto::VolumeRef< int16_t >  vol 
)

◆ applyThreshold()

carto::VolumeRef<int16_t> applyThreshold ( const carto::VolumeRef< int16_t > &  vol,
const int16_t  threshold_lower_bound,
const int16_t  threshold_upper_bound,
const int16_t  new_value = MAX_INT16_T 
)

◆ background()

template<class T >
T background ( std::vector< Component > &  cpnt,
carto::VolumeRef< T > &  vol 
)
inline

◆ background< AimsRGB >()

template<>
AimsRGB background< AimsRGB > ( std::vector< Component > &  cpnt,
carto::VolumeRef< AimsRGB > &  vol 
)
inline

◆ background< AimsRGBA >()

template<>
AimsRGBA background< AimsRGBA > ( std::vector< Component > &  cpnt,
carto::VolumeRef< AimsRGBA > &  vol 
)
inline

◆ changeComponentsIndex()

std::vector<Component> changeComponentsIndex ( std::vector< Component > &  components,
std::vector< int32_t >  dimensionsizes,
std::vector< int32_t >  dimensionorders,
int32_t  offset = 1,
int32_t  step = 1 
)

Referenced by individStackSlices().

◆ compareComponentsByLabelM()

bool compareComponentsByLabelM ( const Component c1,
const Component c2 
)

◆ computeConnexComponent()

carto::VolumeRef<int16_t> computeConnexComponent ( carto::VolumeRef< int16_t > &  vol)

◆ computeHistogramRatio()

template<class T >
float computeHistogramRatio ( const carto::VolumeRef< T > &  vol,
const int32_t  bins 
)

◆ copyToVolume()

bool copyToVolume ( const carto::VolumeRef< int16_t > &  vol,
carto::VolumeRef< int16_t > &  destvol,
const int32_t  x,
const int32_t  X,
const int32_t  y,
const int32_t  Y,
const int32_t  old_label,
const int32_t  new_label 
)

◆ detectSlices()

◆ displayComponentsStrategy()

void displayComponentsStrategy ( const std::vector< Component > &  cpnt)

◆ displayStatus()

void displayStatus ( const Tests t)

◆ extractFromVolume()

carto::VolumeRef<int16_t> extractFromVolume ( const carto::VolumeRef< int16_t > &  vol,
const int32_t  x,
const int32_t  X,
const int32_t  y,
const int32_t  Y,
const int32_t  old_label,
const int32_t  new_label 
)

◆ extractInformationFromComponent()

std::vector<Component> extractInformationFromComponent ( const carto::VolumeRef< int16_t > &  vol)

◆ extractMaxima()

int32_t extractMaxima ( std::vector< int32_t >  vctr)

◆ extractVectorFromComponent()

std::vector<int32_t> extractVectorFromComponent ( std::vector< Component cpnt,
ContinuityParameterTested  param 
)

◆ filterComponentsBySurface()

std::vector<Component> filterComponentsBySurface ( const std::vector< Component > &  cpnt,
const float  min_surface 
)

◆ generateHistogram()

carto::VolumeRef<int32_t> generateHistogram ( const carto::VolumeRef< int16_t > &  vol,
const int32_t  bins = MAX_HISTO 
)

◆ getComponentLabels()

std::vector<int32_t> getComponentLabels ( const std::vector< Component > &  cpnt)

◆ getDimensionCount()

int32_t getDimensionCount ( std::vector< int32_t >  dimensionsizes)

◆ getOutliersBySurface()

std::vector<Component> getOutliersBySurface ( const std::vector< Component > &  cpnt,
const float  min_surface 
)

◆ getOutliersByWeight()

std::vector<Component> getOutliersByWeight ( const std::vector< Component > &  cpnt,
const int32_t  slices_number 
)

◆ getVoxelCount()

template<class T >
int32_t getVoxelCount ( const carto::VolumeRef< T > &  vol,
float  value 
)

◆ getVoxelLebesgue()

template<class T >
float getVoxelLebesgue ( const carto::VolumeRef< T > &  vol)

◆ insertComponent()

std::vector<Component> insertComponent ( std::vector< Component cpnt,
int32_t  comp,
std::vector< Component cpnt2slices,
int32_t  l 
)

◆ isValid()

bool isValid ( const Tests t)

◆ openingComponent()

std::vector<Component> openingComponent ( std::vector< Component > &  cpnt,
int32_t  comp,
carto::VolumeRef< int16_t >  vol,
float  fraction 
)

◆ processMedianConsistencyParameters()

std::vector<Component> processMedianConsistencyParameters ( std::vector< Component > &  cpnt,
float  variation,
int32_t  mid_window = 0 
)

◆ processOutlierComponent()

std::vector<Component> processOutlierComponent ( std::vector< Component > &  cpnt,
carto::VolumeRef< int16_t > &  vol,
int32_t  min_surface,
int32_t  slices_number,
float  fraction 
)

◆ projectData()

carto::VolumeRef<int32_t> projectData ( carto::VolumeRef< int16_t > &  X)

◆ removeComponent()

std::vector<Component> removeComponent ( std::vector< Component cpnt,
int32_t  l 
)

◆ removeComponents()

std::vector<Component> removeComponents ( const std::vector< Component > &  cpnt,
const std::vector< Component > &  to_remove 
)

◆ removeComponentsInVolume()

bool removeComponentsInVolume ( carto::VolumeRef< int16_t > &  vol,
const std::vector< Component > &  to_remove 
)

◆ rescale()

template<class T >
void rescale ( carto::VolumeRef< T > &  in,
carto::RescalerInfo &  info 
)

◆ separateComponent()

std::vector<Component> separateComponent ( std::vector< Component > &  cpnt,
int32_t  comp,
carto::VolumeRef< int16_t >  vol,
int32_t  min_surface,
Direction  dir,
float  fraction 
)

◆ sortComponent()

std::vector<Component> sortComponent ( std::vector< Component > &  cpnt,
std::vector< int32_t >  dimensionsizes 
)

Referenced by individStackSlices().

◆ testComponents()

Tests testComponents ( const std::vector< Component > &  cpnt,
int32_t  number_cpnt 
)

◆ transposeVolume()

carto::VolumeRef<int16_t> transposeVolume ( carto::VolumeRef< int16_t > &  vol)

◆ updateVDM()

std::vector<AimsVector<int32_t, 3> > updateVDM ( std::vector< AimsVector< int32_t, 3 > > &  vdm)

◆ weightedRemoveComponents()

std::vector<Component> weightedRemoveComponents ( std::vector< Component > &  cpnt,
int32_t  slices_number 
)

◆ writeAimsFloat()

void writeAimsFloat ( carto::VolumeRef< float > &  vol)

◆ writeAimsInt32_t()

void writeAimsInt32_t ( carto::VolumeRef< int32_t > &  vol)

◆ writeComponents()

void writeComponents ( std::vector< Component > &  comp)

Referenced by individStackSlices().

◆ writeMaxima()

void writeMaxima ( std::vector< Maxima > &  mxm)

◆ writeMaximaIter()

void writeMaximaIter ( std::vector< Maxima > &  mxm,
int32_t  iter 
)

◆ writeNumberedSlices()

template<class T >
bool writeNumberedSlices ( int32_t  dx,
int32_t  dy,
int32_t  res,
float  z,
background,
std::vector< Component > &  cpnt,
carto::VolumeRef< T > &  vol,
std::string  outputdir,
std::string  outputname,
std::string  format,
uint8_t  slicemin 
)

◆ writeStackedSlices()

template<class T >
bool writeStackedSlices ( int32_t  dx,
int32_t  dy,
int32_t  res,
float  z,
background,
std::vector< Component > &  cpnt,
carto::VolumeRef< T > &  vol,
std::string  outputfile,
std::string  format 
)

◆ writeVector3int32_t()

void writeVector3int32_t ( std::vector< AimsVector< int32_t, 3 > > &  vect)

◆ writeVectorInt32_t()

void writeVectorInt32_t ( std::vector< int32_t > &  vect)