#include "mitkImage.h"#include "mitkHistogramGenerator.h"#include "mitkPicHelper.h"#include "mitkImageTimeSelector.h"#include "ipFunc/mitkIpFunc.h"#include "mitkIpPicTypeMultiplex.h"#include <itkSmartPointerForwardReference.txx>#include <vtkImageData.h>#include "mitkImageAccessByItk.h"Go to the source code of this file.
Functions | |
| template<class T > | |
| void | AccessPixel (mitkIpPicDescriptor *pic, const mitk::Index3D &p, double &value, int timestep) |
| void AccessPixel | ( | mitkIpPicDescriptor * | pic, |
| const mitk::Index3D & | p, | ||
| double & | value, | ||
| int | timestep | ||
| ) |
Definition at line 97 of file mitkImage.cpp.
Referenced by mitk::Image::GetPixelValueByIndex(), and mitk::Image::GetPixelValueByWorldCoordinate().
{
if ( (p[0]>=0 && p[1] >=0 && p[2]>=0 && timestep>=0) && (unsigned int)p[0] < pic->n[0] && (unsigned int)p[1] < pic->n[1] && (unsigned int)p[2] < pic->n[2] && (unsigned int)timestep < pic->n[3] )
{
if(pic->bpe!=24)
{
value = (double) (((T*) pic->data)[ p[0] + p[1]*pic->n[0] + p[2]*pic->n[0]*pic->n[1] + timestep*pic->n[0]*pic->n[1]*pic->n[2] ]);
}
else
{
double returnvalue = (((T*) pic->data)[p[0]*3 + 0 + p[1]*pic->n[0]*3 + p[2]*pic->n[0]*pic->n[1]*3 + timestep*pic->n[0]*pic->n[1]*pic->n[2]*3 ]);
returnvalue += (((T*) pic->data)[p[0]*3 + 1 + p[1]*pic->n[0]*3 + p[2]*pic->n[0]*pic->n[1]*3 + timestep*pic->n[0]*pic->n[1]*pic->n[2]*3]);
returnvalue += (((T*) pic->data)[p[0]*3 + 2 + p[1]*pic->n[0]*3 + p[2]*pic->n[0]*pic->n[1]*3 + timestep*pic->n[0]*pic->n[1]*pic->n[2]*3]);
value = returnvalue;
}
}
else
{
value = 0;
}
};
1.7.2