18 #include <ImageStack/ImageStack.h> 19 #include <ImageStack/ImageStackLoaderBST.h> 20 #include <ImageStack/ResolutionDecorator.h> 40 template <
class F>
void loadFromBST(std::string
const &filename, F &&f) {
41 using Decorator = ImageStack::ResolutionDecorator;
42 using Img = ImageStack::ImageStack<float, ImageStack::HostStorage, Decorator>;
43 using Loader = ImageStack::ImageStackLoaderBST<Img>;
45 auto const img = Img(Loader(filename));
47 auto const mapping = img.map();
48 auto const size = img.size().template cast<std::size_t>().eval();
49 auto const resol = img.resolution.template cast<float>().eval();
50 VoxelSize voxelSize{resol.x(), resol.y(), resol.z()};
51 VolumeSize volumeSize{size.x(), size.y(), size.z()};
53 f(mapping.data(), volumeSize, voxelSize);
Name namespace for CortidQCT library.
Definition: CortidQCT.h:23
This header contains the definition of the VoxelSize type.
void loadFromBST(std::string const &filename, F &&f)
Loads a BST file and calles the given functional with the loaded data.
Definition: LoadFromBST.h:40
Size type for a 3D voxel.
Definition: VolumeSize.h:22
Size type for a 3D voxel.
Definition: VoxelSize.h:22
This header contains the definition of the VolumeSize type.