MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / findColmapFilesInternal

Function findColmapFilesInternal

src/utils/fileClassification.ts:50–72  ·  view source on GitHub ↗
(
  files: Map<string, File>,
  options: { requirePoints3D: boolean }
)

Source from the content-addressed store, hash-verified

48}
49
50function findColmapFilesInternal(
51 files: Map<string, File>,
52 options: { requirePoints3D: boolean }
53): ColmapFileSelection {
54 // Resolve the best COLMAP model directory from the dropped/scanned paths.
55 // The resolver returns the exact map keys it selected, so each maps straight
56 // back to its File. Works for sparse/0, colmap/, the root, or nested layouts.
57 const selection = resolveColmapPaths(files.keys(), {
58 requirePoints3D: options.requirePoints3D,
59 });
60 if (!selection) {
61 return {};
62 }
63
64 return {
65 camerasFile: selection.cameras ? files.get(selection.cameras) : undefined,
66 imagesFile: selection.images ? files.get(selection.images) : undefined,
67 points3DFile: selection.points3D ? files.get(selection.points3D) : undefined,
68 databaseFile: selection.database ? files.get(selection.database) : undefined,
69 rigsFile: selection.rigs ? files.get(selection.rigs) : undefined,
70 framesFile: selection.frames ? files.get(selection.frames) : undefined,
71 };
72}
73
74/**
75 * Check if the file map contains COLMAP files

Callers 2

findColmapFilesFunction · 0.85

Calls 2

resolveColmapPathsFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected