Skip to content

tdd and readme#71

Open
ccapetz wants to merge 1 commit into
carter-mrd-vizfrom
add-mrd-viz-tdd
Open

tdd and readme#71
ccapetz wants to merge 1 commit into
carter-mrd-vizfrom
add-mrd-viz-tdd

Conversation

@ccapetz

@ccapetz ccapetz commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

added a brief readme and detailed technical design doc in docs/TECHNICAL_DESIGN.md. requesting review for the TDD to make sure everything looks good and is aligned with expectations.

@@ -0,0 +1,585 @@
# MRD Viz Technical Design

Status: Draft

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say this is no longer a draft :)


Stage 1 should use external and existing logic carefully:

- Use `file-format/mrd/python/mrd/tools/minimal_example.py` as the reference for basic MRD header and stream reading.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these paths dont exist in the current repo so either take them out (or explicitly state they are not present) or reference the paths that do exist in this repo

- validate that the header is present and the stream can be consumed
- classify files by stream item type, not filename
- extract one representative display plane from each MRD image stream item for the Stage 1 mosaic
- normalize complex, integer, or floating image data into grayscale 8-bit PNG output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are relying on export_png_images.py to do this, correct?


### Local setup and rollout

Stage 1 setup should be Windows-first, with no architecture choices that prevent later macOS or Linux support.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand what you mean by "windows first" - does it mean that the way you build and install an extension on vscode will be different depending on the OS? or do you simply mean that building locally in windows is different vs linux?

if I were to make a suggestion, i'd say build this for Linux first, it will likely be easier (you can use WSL) but let me know if I am missing a detail of why Windows should be first (I ask because both John and Joe have mac's so if the extension is specific to windows they likely wont be able to run it)

- `mrd-viz image <path> --index <n>`: return one larger/full-resolution temporary PNG path and metadata for a selected mosaic tile.
- `mrd-viz classify <path>`: return a lightweight classification payload for batch workflows.
- `mrd-viz html <path> --output <html>`: write a static HTML mosaic harness for fast UI iteration before the VS Code frontend exists.
- `mrd-viz inspect <path>`: supported as a temporary alias for `open` while naming settles.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd say lets settle on a name now and call it good :) mrd-viz sounds good to me

```json
{
"ok": true,
"schema_version": 1,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not see a section about backwards compatibility (sorry if I missed it), but need to answer questions like: will the extension reject unknown schema versions? Will it attempt best-effort rendering?

- MRD reader: uses `mrd-python` as the only Stage 1 format parser.
- Summary JSON: carries schema version, file class, display mode, header summary, stream counts, warnings, raw-only states, and error envelopes.
- Preview PNG data: uses base64 PNGs for bounded thumbnails and temporary PNG paths for lazy full-size image requests.
- Webview UI: renders the mosaic, selected image, metadata panel, loading states, unsupported states, and controlled errors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what error views are we going to support? I.e. it would be nice to explicitly list the expected errors we may get (wrong version, wrong format, error in the way file is formatted...there are probably more)


### Loading and caching

- Read eagerly: header, stream item counts, image metadata, acquisition examples, and up to 128 thumbnail PNGs for the image-item mosaic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit misleading: you can read the header without reading the whole file, but you cannot get item counts without reading the whole file.

@yuliadub

Copy link
Copy Markdown
Collaborator

looks good - all the changes cover everything we talked about, thanks for including all that! a few follow up comments but nothing major. excited to try out a first version of the extension soon!

@ccapetz ccapetz changed the base branch from main to carter-mrd-viz June 18, 2026 22:01
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.

2 participants