pub struct DatasetRegistry {
pub odometry: HashMap<String, OdometryEntry>,
pub bundle_adjustment: HashMap<String, BaEntry>,
}Expand description
The complete dataset registry, parsed from datasets.toml.
Fields§
§odometry: HashMap<String, OdometryEntry>Odometry datasets keyed by short name (e.g. "sphere2500", "intel").
bundle_adjustment: HashMap<String, BaEntry>Bundle adjustment datasets keyed by collection name (e.g. "ladybug").
Implementations§
Source§impl DatasetRegistry
impl DatasetRegistry
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load the registry from the compile-time embedded datasets.toml.
§Errors
Returns an error only if datasets.toml is malformed TOML — a
developer error that should never occur with the bundled file.
Sourcepub fn odometry_path(&self, name: &str) -> Option<PathBuf>
pub fn odometry_path(&self, name: &str) -> Option<PathBuf>
Returns the on-disk path for an odometry dataset, including its category subdirectory.
Returns None if name is not in the registry.
§Example
use apex_io::DatasetRegistry;
let reg = DatasetRegistry::load()?;
assert_eq!(
reg.odometry_path("intel"),
Some(std::path::Path::new("data/odometry").join("2d").join("intel.g2o"))
);Sourcepub fn odometry_by_category(
&self,
category: &str,
) -> Vec<(&str, &OdometryEntry)>
pub fn odometry_by_category( &self, category: &str, ) -> Vec<(&str, &OdometryEntry)>
Returns all odometry entries with the given category ("2d" or "3d"),
sorted alphabetically by name for deterministic output.
Sourcepub fn ba_path(&self, name: &str, cameras: u32, points: u32) -> Option<PathBuf>
pub fn ba_path(&self, name: &str, cameras: u32, points: u32) -> Option<PathBuf>
Returns the on-disk path for a specific BA problem file.
The path follows the same layout the downloader creates:
data/bundle_adjustment/{name}/problem-{cameras}-{points}-pre.txt
Returns None if name is not in the registry.
Trait Implementations§
Source§impl Debug for DatasetRegistry
impl Debug for DatasetRegistry
Source§impl<'de> Deserialize<'de> for DatasetRegistry
impl<'de> Deserialize<'de> for DatasetRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DatasetRegistry
impl RefUnwindSafe for DatasetRegistry
impl Send for DatasetRegistry
impl Sync for DatasetRegistry
impl Unpin for DatasetRegistry
impl UnsafeUnpin for DatasetRegistry
impl UnwindSafe for DatasetRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.