Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mipview"
version = "0.4.2"
version = "0.4.3"
description = "A lightweight Linux-first NIfTI viewer for patch-based inspection workflows."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
31 changes: 30 additions & 1 deletion src/mipview/control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ mipview-ctl patch select

### `patch.export_raw`

Function: Export selected patch arrays and metadata, including annotation or segmentation patch arrays when available.
Function: Export selected patch arrays and metadata to a compressed `.npz`
archive. When an active annotation mask or file-backed active segmentation is
available, their patch arrays are exported with the same selected patch bounds as
the image patch.

CLI usage:

Expand All @@ -294,6 +297,32 @@ Parameters:
| --- | --- | --- |
| `path` | `str` | Output `.npz` path. The parent directory must exist and be writable. |

The `.npz` archive always includes:

| Key | Description |
| --- | --- |
| `image_patch` | Raw selected image patch array. |
| `bounds` | Half-open source voxel bounds as `[[x0, x1], [y0, y1], [z0, z1]]`. |
| `patch_size` | Current requested patch size as `[sx, sy, sz]`. |
| `patch_center` | Current patch center voxel as `[x, y, z]`, when available. |
| `affine` | Patch affine. |
| `voxel_spacing` | Patch voxel spacing. |
| `source_image_path` | Loaded source image path, or an empty string. |
| `viewer_state_json` | JSON string containing the exported viewer state. |

The archive conditionally includes:

| Key | Included when |
| --- | --- |
| `annotation_patch` | An active annotation mask exists. The patch is extracted in voxel space using the same bounds as `image_patch`. |
| `segmentation_patch` | The active segmentation is a loaded file segmentation. Annotation-backed segmentations are not duplicated here. |

The command response includes `annotation_included` and `segmentation_included`
booleans so clients can tell which optional arrays were written.

This command exports selected patch arrays only. It does not provide standalone
full-volume annotation or segmentation `.npz` export commands.

Example:

```bash
Expand Down
Loading
Loading