MeshLib Documentation
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#include <optional>
12
13namespace MR
14{
15
16namespace VoxelsLoad
17{
18
21MRVOXELS_API bool isDicomFile( const std::filesystem::path& path, std::string* seriesUid = nullptr );
22
24{
25 SimpleVolumeMinMax vol;
26 std::string name;
27 AffineXf3f xf;
28};
29
31{
32 VdbVolume vdbVolume;
33 std::string name;
34 AffineXf3f xf;
35};
36
38MRVOXELS_API std::vector<Expected<LoadDCMResult>> loadDCMsFolder( const std::filesystem::path& path,
39 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
41MRVOXELS_API Expected<LoadDCMResult> loadDCMFolder( const std::filesystem::path& path,
42 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
43
45MRVOXELS_API std::vector<Expected<DicomVolume>> loadDicomsFolder( const std::filesystem::path& path,
46 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
48MRVOXELS_API Expected<DicomVolume> loadDicomFolder( const std::filesystem::path& path,
49 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
50
52MRVOXELS_API std::vector<Expected<LoadDCMResult>> loadDCMFolderTree( const std::filesystem::path& path,
53 unsigned maxNumThreads = 4, const ProgressCallback& cb = {} );
54
57
59MRVOXELS_API Expected<DicomVolume> loadDicomFile( const std::filesystem::path& path, const ProgressCallback& cb = {} );
60
61} // namespace VoxelsLoad
62
63namespace VoxelsSave
64{
65
67MRVOXELS_API Expected<void> toDCM( const VdbVolume& vdbVolume, const std::filesystem::path& path, ProgressCallback cb = {} );
70template <typename T>
71MRVOXELS_API Expected<void> toDCM( const VoxelsVolume<std::vector<T>>& volume, const std::filesystem::path& path, const std::optional<MinMaxf>& sourceScale = {}, const ProgressCallback& cb = {} );
72
73} // namespace VoxelsSave
74
75} // namespace MR
76#endif
#define MRVOXELS_API
Definition MRVoxelsFwd.h:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
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:24
std::string name
Definition MRDicom.h:26
AffineXf3f xf
Definition MRDicom.h:27
SimpleVolumeMinMax vol
Definition MRDicom.h:25
Definition MRDicom.h:31
std::string name
Definition MRDicom.h:33
AffineXf3f xf
Definition MRDicom.h:34
VdbVolume vdbVolume
Definition MRDicom.h:32
represents a box in 3D space subdivided on voxels stored in T
Definition MRVoxelsVolume.h:39