61 using Pointer = std::shared_ptr<VolumePkg>;
75 static auto New(
const filesystem::path& path) ->
Pointer;
84 [[nodiscard]]
auto name() const -> std::
string;
95 [[nodiscard]] auto
version() const ->
int;
126 template <typename T>
159 [[nodiscard]] auto
volumeNames() const -> std::vector<std::
string>;
246 [[nodiscard]] auto
renderNames() const -> std::vector<std::
string>;
324 const
Volume::Identifier& src, const
Volume::Identifier& tgt) const
335 const filesystem::path& path,
VolumePkg metadata templates.
The interface to the VolumePkg (.volpkg) file format.
auto removeSegmentation(const Segmentation::Identifier &id) -> bool
Removes an existing segmentation.
void setTransform(const Transform3D::Identifier &id, const Transform3D::Pointer &transform)
Replace an existing transform.
std::map< Transform3D::Identifier, Transform3D::Pointer > transforms_
auto renderNames() const -> std::vector< std::string >
Get the list of Render names.
auto hasVolumes() const -> bool
Return whether there are Volumes.
auto transformIDs() const -> std::vector< Transform3D::Identifier >
Get the list of transform IDs.
void saveMetadata(const filesystem::path &filePath) const
Saves the metadata to a user-specified location.
filesystem::path rootDir_
VolumePkg(const filesystem::path &path)
Construct a VolumePkg from a .volpkg file stored at fileLocation.
auto newRender(std::string name="") -> Render::Pointer
Creates a new Render.
std::map< Render::Identifier, Render::Pointer > renders_
static auto New(const filesystem::path &path, int version) -> Pointer
Construct an empty VolumePkg of a specific version number.
auto renderIDs() const -> std::vector< Render::Identifier >
Get the list of Render IDs.
auto segmentationNames() const -> std::vector< std::string >
Get the list of Segmentation names.
auto volumeNames() const -> std::vector< std::string >
Get the list of volumes names.
auto hasRenders() const -> bool
Return whether there are Renders.
auto numberOfSegmentations() const -> std::size_t
Get the number of Segmentations.
static void Upgrade(const filesystem::path &path, int version=VOLPKG_VERSION_LATEST, bool force=false)
auto hasTransforms() const -> bool
Return whether there are transforms in the VolumePkg.
auto materialThickness() const -> double
Returns the approx. thickness of a material layer in microns (um).
void setMetadata(const std::string &key, T value)
Sets the value of key in the VolumePkg metadata.
void saveMetadata() const
Saves the metadata to the VolumePkg (.volpkg) file.
auto hasTransform(const Transform3D::Identifier &id) const -> bool
Return whether a transform with the given identifier is in the VolumePkg.
VolumePkg(filesystem::path path, int version)
Construct an empty VolumePkg of a specific version number.
auto hasSegmentations() const -> bool
Return whether there are Segmentations.
auto version() const -> int
Returns the VolumePkg version.
auto newSegmentation(std::string name="") -> Segmentation::Pointer
Creates a new segmentation.
std::map< Segmentation::Identifier, Segmentation::Pointer > segmentations_
auto hasVolume(const Volume::Identifier &id) const -> bool
Whether a volume with the given identifier is in the VolumePkg.
auto render(const Render::Identifier &id) const -> Render::Pointer
Get a Render by uuid.
auto volume() const -> Volume::Pointer
Get the first Volume.
auto segmentation(const Segmentation::Identifier &id) const -> Segmentation::Pointer
Get a Segmentation by uuid.
static auto New(const filesystem::path &path) -> Pointer
auto transform(Transform3D::Identifier id) const -> Transform3D::Pointer
Get a transform by ID.
auto segmentationIDs() const -> std::vector< Segmentation::Identifier >
Get the list of Segmentation IDs.
std::shared_ptr< VolumePkg > Pointer
auto addTransform(const Transform3D::Pointer &transform) -> Transform3D::Identifier
Add a transform to the VolPkg.
std::map< Volume::Identifier, Volume::Pointer > volumes_
auto newVolume(std::string name="") -> Volume::Pointer
Add a new Volume to the VolumePkg.
auto name() const -> std::string
Returns the identifying name of the VolumePkg.
static auto InitConfig(const Dictionary &dict, int version) -> Metadata
Populates an empty VolumePkg::config from a volcart::Dictionary template.
auto numberOfRenders() const -> std::size_t
Get the number of Renders.
auto metadata() const -> Metadata
Return the VolumePkg Metadata.
auto numberOfVolumes() const -> std::size_t
Get the number of Volumes.
auto volumeIDs() const -> std::vector< Volume::Identifier >
Get the list of volume IDs.
Volume Cartographer library
static constexpr int VOLPKG_VERSION_LATEST
Volume Package version generated by this release
std::unordered_map< DictionaryEntryKey, DictionaryEntryType > Dictionary