MeshLib
 
Loading...
Searching...
No Matches
MRDicom.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
4#ifndef MRVOXELS_NO_DICOM
5#include "MRVoxelsVolume.h"
6
7#include "MRMesh/MRAffineXf.h"
8#include "MRMesh/MRMatrix3.h"
9
10#include <filesystem>
11
12namespace MR
13{
14
15namespace VoxelsLoad
16{
17
20MRVOXELS_API bool isDicomFile( const std::filesystem::path& path, std::string* seriesUid = nullptr );
21
23{
24 SimpleVolumeMinMax vol;
25 std::string name;
27};
28
30{
31 VdbVolume vdbVolume;
32 std::string name;
34};
35
37MRVOXELS_API std::vector<Expected<LoadDCMResult>> loadDCMsFolder( const std::filesystem::path& path,
38 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
40MRVOXELS_API Expected<LoadDCMResult> loadDCMFolder( const std::filesystem::path& path,
41 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
42
44MRVOXELS_API std::vector<Expected<DicomVolume>> loadDicomsFolder( const std::filesystem::path& path,
45 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
47MRVOXELS_API Expected<DicomVolume> loadDicomFolder( const std::filesystem::path& path,
48 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
49
51MRVOXELS_API std::vector<Expected<LoadDCMResult>> loadDCMFolderTree( const std::filesystem::path& path,
52 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
53
56
58MRVOXELS_API Expected<DicomVolume> loadDicomFile( const std::filesystem::path& path, const ProgressCallback& cb = {} );
59
60} // namespace VoxelsLoad
61
62namespace VoxelsSave
63{
64
66MRVOXELS_API Expected<void> toDCM( const VdbVolume& vdbVolume, const std::filesystem::path& path, ProgressCallback cb = {} );
67template <typename T>
68MRVOXELS_API Expected<void> toDCM( const VoxelsVolume<std::vector<T>>& volume, const std::filesystem::path& path, ProgressCallback cb = {} );
69
70} // namespace VoxelsSave
71
72} // namespace MR
73#endif
#define MRVOXELS_API
Definition MRVoxelsFwd.h:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:571
MRVOXELS_API std::vector< Expected< DicomVolume > > loadDicomsFolder(const std::filesystem::path &path, unsigned maxNumThreads=4, const ProgressCallback &cb={})
Loads 3D all volumetric data from DICOM files in a folder.
MRVOXELS_API Expected< DicomVolume > loadDicomFile(const std::filesystem::path &path, const ProgressCallback &cb={})
Loads 3D volumetric data from a single DICOM file.
MRVOXELS_API Expected< LoadDCMResult > loadDCMFolder(const std::filesystem::path &path, unsigned maxNumThreads=4, const ProgressCallback &cb={})
Loads 3D first volumetric data from DICOM files in a folder.
MRVOXELS_API Expected< DicomVolume > loadDicomFolder(const std::filesystem::path &path, unsigned maxNumThreads=4, const ProgressCallback &cb={})
Loads 3D first volumetric data from DICOM files in a folder.
MRVOXELS_API std::vector< Expected< LoadDCMResult > > loadDCMFolderTree(const std::filesystem::path &path, unsigned maxNumThreads=4, const ProgressCallback &cb={})
Loads every subfolder with DICOM volume as new object.
MRVOXELS_API bool isDicomFile(const std::filesystem::path &path, std::string *seriesUid=nullptr)
MRVOXELS_API std::vector< Expected< LoadDCMResult > > loadDCMsFolder(const std::filesystem::path &path, unsigned maxNumThreads=4, const ProgressCallback &cb={})
Loads 3D all volumetric data from DICOM files in a folder.
MRVOXELS_API Expected< std::shared_ptr< ObjectVoxels > > createObjectVoxels(const LoadDCMResult &dcm, const ProgressCallback &cb={})
converts LoadDCMResult in ObjectVoxels
MRVOXELS_API Expected< void > toDCM(const VdbVolume &vdbVolume, const std::filesystem::path &path, ProgressCallback cb={})
Save voxels objet to a single 3d DICOM file.
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:58
Definition MRDicom.h:23
std::string name
Definition MRDicom.h:25
AffineXf3f xf
Definition MRDicom.h:26
SimpleVolumeMinMax vol
Definition MRDicom.h:24
Definition MRDicom.h:30
std::string name
Definition MRDicom.h:32
AffineXf3f xf
Definition MRDicom.h:33
VdbVolume vdbVolume
Definition MRDicom.h:31
represents a box in 3D space subdivided on voxels stored in T
Definition MRVoxelsVolume.h:38