Skip to content

Jigsaw isdlist#6004

Open
oleg-alexandrov wants to merge 8 commits intoDOI-USGS:devfrom
oleg-alexandrov:jigsaw_isdlist
Open

Jigsaw isdlist#6004
oleg-alexandrov wants to merge 8 commits intoDOI-USGS:devfrom
oleg-alexandrov:jigsaw_isdlist

Conversation

@oleg-alexandrov
Copy link
Copy Markdown
Contributor

@oleg-alexandrov oleg-alexandrov commented Mar 26, 2026

Description

Added the ISDLIST parameter to jigsaw that loads CSM cameras from external ISD or model state files instead of cube blobs. Cubes are not modified. Adjusted camera state is written to .adjusted_state.json files.

Fixed OUTPUT_ADJUSTED_CSMSTATE to write the actual adjusted state from the bundle solution. (With the ISDLIST option the writing happens regardless of this one.)

Added an example in the jigsaw documentation.

Note: Some CSM camera pointers can't be managed properly because in tests they are pointers to existing objects on stack, but within jigsaw they are honest pointers. At the level they are being passed in we don't know and can't safely delete them. Fixing this would require using smart pointers thoughout.

Related Issues

How Has This Been Validated?

Added tests for both options.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Infrastructure change (changes to things like CI or the build system that do not impact users)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added myself to the .zenodo.json document.
  • I have added my user impacting change to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

Add ISDLIST parameter to jigsaw that loads CSM cameras from external
ISD or model state files instead of cube blobs. Cubes are not modified.
Adjusted camera state is written to .adjusted_state.json files.

Key changes:
- CameraFactory: add CreateFromIsd(), updateLabelForCsm(),
  writeAdjustedCsmState(), constructModelFromIsdOrState()
- BundleAdjust: thread ISDLIST through constructors, rebuild serial
  numbers with in-memory CsmInfo injection (same approach as csminit)
- ControlNet::SetImages: dispatch to CreateFromIsd for ISDLIST images
- SerialNumberList: add(Pvl&) overload for in-memory label support
- jigsaw.cpp: consolidated state writing, ISDLIST+OUTPUT_ADJUSTED_CSMSTATE
  incompatibility check, ISDLIST example in XML
- CSMCamera: fix memory leak (m_model never freed), add destructor
- GTest: extend CSMNetwork.FunctionalTestJigsawCSM to test both
  OUTPUT_ADJUSTED_CSMSTATE and ISDLIST with model state files
@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

Eliminates the model->state->model round-trip in CreateFromIsd().
The new constructor takes ownership of an already-constructed CSM
model, skipping string serialization and plugin iteration. Extracted
initFromModel() for shared metadata setup across all constructors.
Also cleaned up a stale TODO comment and trailing whitespace in
jigsaw.cpp.
@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

Test mocks pass stack-allocated MockRasterGM via constructModelFromState(),
so m_model cannot be deleted. The pre-existing leak is upstream by design.
Updated changelog to remove leak fix mention.
@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@oleg-alexandrov
Copy link
Copy Markdown
Contributor Author

Tests pass.

Fix misleading ownership comments in CSMCamera and CameraFactory
(model pointer is not managed, pre-existing issue). Use FileList
for ISD list parsing, consistent with cube list parsing.
@github-actions
Copy link
Copy Markdown

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_6004".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

@Kelvinrr Kelvinrr requested review from Kelvinrr and acpaquette March 27, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant