|
NorMIT-nav
22.09
An IGT application
|
Go to the documentation of this file.
14 #include "vtkImageData.h"
52 return QString(
"%1/%2").arg(root).arg(suffix);
69 QString unique_string =
qstring_cast(
reinterpret_cast<long>(vtkImageData.GetPointer()));
70 QString imagesUid = QString(
"TESTUID_%2_%1").arg(unique_string);
79 std::vector<cx::ImagePtr> retval;
80 for (
unsigned i=0; i<count; ++i)
83 retval.push_back(image);
93 unsigned char* ptr =
reinterpret_cast<unsigned char*
>(image->GetScalarPointer());
94 unsigned int pixelCount = 0;
95 for (
unsigned i = 0; i < image->GetDimensions()[0]*image->GetDimensions()[1]*image->GetDimensions()[2]; ++i)
97 if (ptr[i*image->GetNumberOfScalarComponents()+component] > threshold)
111 Eigen::Array3i dim(image->GetDimensions());
112 unsigned int totalPixels = dim[0]*dim[1]*dim[2];
115 return double(hits)/double(totalPixels);
static QString getDataRoot(QString suffix="")
QString qstring_cast(const T &val)
static std::vector< cx::ImagePtr > create3DImages(unsigned int imageCount, Eigen::Array3i dim=Eigen::Array3i(3, 3, 3), const unsigned int voxelValue=100)
static QString getTestDataPath()
return path to test data folder
static unsigned int getNumberOfNonZeroVoxels(vtkImageDataPtr image)
vtkImageDataPtr generateVtkImageData(Eigen::Array3i dim, Vector3D spacing, const unsigned char initValue, int components)
static double getFractionOfVoxelsAboveThreshold(vtkImageDataPtr image, int threshold, int component=0)
boost::shared_ptr< class Image > ImagePtr
static cx::ImagePtr create3DImage(Eigen::Array3i dim=Eigen::Array3i(3, 3, 3), const unsigned int voxelValue=100)
static vtkImageDataPtr create3DVtkImageData(Eigen::Array3i dim=Eigen::Array3i(3, 3, 3), const unsigned int voxelValue=100)
static void sleep_sec(int seconds)
static unsigned int getNumberOfVoxelsAboveThreshold(vtkImageDataPtr image, int threshold, int component=0)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.