Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxMax.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxMax (HxImageRep im1, HxImageRep im2)
 Maximum. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxMax HxImageRep    im1,
HxImageRep    im2
 

Maximum.

The function performs maximum (see Pixels) on all pixels in the input images via a binary pixel operation (see Images).

Implementation specifics : The pixel functor : HxBpoMax. The image functor instantiator : HxInstantiatorMax.

00014 {
00015     HxString fname("HxMax");
00016 
00017     if (im1.isNull())
00018     {
00019         HxGlobalError::instance()->reportError(fname, im1.name(), "null image", HxGlobalError::HX_GE_INVALID);
00020         return HxImageRep();
00021     }
00022     if (im2.isNull())
00023     {
00024         HxGlobalError::instance()->reportError(fname, im2.name(), "null image", HxGlobalError::HX_GE_INVALID);
00025         return HxImageRep();
00026     }
00027 
00028     if (im1.dimensionality() != im2.dimensionality())
00029     {
00030         HxGlobalError::instance()->reportError(fname, "unequal image dimensionalities", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00031         return HxImageRep();
00032     }
00033     if ((im1.pixelDimensionality() != 1) || (im2.pixelDimensionality() != 1))
00034     {
00035         HxGlobalError::instance()->reportError(fname, "operation only valid on scalar types", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00036         return HxImageRep();
00037     }
00038 
00039     if (im1.sizes().x() != im2.sizes().x())
00040     {
00041         HxGlobalError::instance()->reportError(fname, "unequal image widths", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00042         return HxImageRep();
00043     }
00044     if (im1.sizes().y() != im2.sizes().y())
00045     {
00046         HxGlobalError::instance()->reportError(fname, "unequal image heights", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00047         return HxImageRep();
00048     }
00049     if (im1.dimensionality() > 2)
00050     {
00051         if (im1.sizes().z() != im2.sizes().z())
00052         {
00053             HxGlobalError::instance()->reportError(fname, "unequal image depths", HxGlobalError::HX_GE_UNEQUAL_IMAGES);
00054             return HxImageRep();
00055         }
00056     }
00057 
00058     return im1.binaryPixOp(im2, "max");
00059 }


Generated on Mon Jan 27 15:48:54 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001