Skip to content

Commit

Permalink
refactor(apply-presentation-state-to-image): presentation-state-file is
Browse files Browse the repository at this point in the history
arg

Bumping itk-wasm, helps with a 'required option'.

BREAKING_CHANGE: apply-presentation-state-to-image presentation-state-file is an argument, as opposed to an optional parameter, since it is required.
  • Loading branch information
thewtex committed Apr 27, 2023
1 parent e71e47d commit 2ced230
Show file tree
Hide file tree
Showing 40 changed files with 68 additions and 1,391 deletions.
5 changes: 5 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ For a log and guide when transitioning from itk.js to itk-wasm,
please see [the migration
guide](doc/content/docs/itk_js_to_itk_wasm_migration_guide.md).

## From 1.0.0-b.101 to 1.0.0-b.102

- apply-presentation-state-to-image presentation-state-file is an argument, as
opposed to an optional parameter, since it is required.

## From 1.0.0-b.72 to 1.0.0-b.73

- Emscripten modules no longer support filesystem-based IO for binary size / performance.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
"build:bindgen:python:compress-stringify": "./src/itk-wasm-cli.js -s packages/compress-stringify -b wasi-build bindgen --language python --package-name itkwasm-compress-stringify --package-description \"Zstandard compression and decompression and base64 encoding and decoding in WebAssembly.\" --package-version 0.4.4 --repository 'https://github.com/InsightSoftwareConsortium/itk-wasm'",
"build:emscripten:dicom": "node ./src/itk-wasm-cli.js -s packages/dicom -b emscripten-build build ",
"build:bindgen:typescript:dicom": "./src/itk-wasm-cli.js -s packages/dicom -b emscripten-build bindgen --package-version 0.3.0 --package-name @itk-wasm/dicom --package-description \"Read files and images related to DICOM file format.\" --repository 'https://github.com/InsightSoftwareConsortium/itk-wasm'",
"build:bindgen:python:dicom": "./src/itk-wasm-cli.js -s packages/dicom -b wasi-build bindgen --package-version 0.3.0 --package-name itkwasmr-dicom --package-description \"Read files and images related to DICOM file format.\" --repository 'https://github.com/InsightSoftwareConsortium/itk-wasm'",
"build:emscripten:packages": "npm run build:emscripten:compress-stringify && npm run build:bindgen:typescript:compress-stringify && npm run build:emscripten:dicom && npm run build:bindgen:typescript:dicom",
"build:wasi": "node ./src/build-wasi.js && npm run build:wasi:packages",
"build:wasi:compress-stringify": "node ./src/itk-wasm-cli.js -i itkwasm/wasi:latest -s packages/compress-stringify -b wasi-build build",
"build:wasi:dicom": "node ./src/itk-wasm-cli.js -i itkwasm/wasi:latest -s packages/dicom -b wasi-build build",
"build:wasi:packages": "npm run build:wasi:compress-stringify && npm run build:bindgen:python:compress-stringify",
"cypress:open": "npx cypress open",
"cypress:run": "npx cypress run --config defaultCommandTimeout=8000",
Expand Down
8 changes: 5 additions & 3 deletions packages/dicom/apply-presentation-state-to-image.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,19 @@ static void dumpPresentationState(STD_NAMESPACE ostream &out, DVPresentationStat
int main(int argc, char *argv[])
{
itk::wasm::Pipeline pipeline("apply-presentation-state-to-image", "Apply a presentation state to a given DICOM image and render output as pgm bitmap or dicom file.", argc, argv);

// Inputs
std::string imageIn;
pipeline.add_option("image-in", imageIn, "Input DICOM file")->required()->check(CLI::ExistingFile)->type_name("INPUT_BINARY_FILE");

std::string pstateFile;
pipeline.add_option("presentation-state-file", pstateFile, "Process using presentation state file")->required()->check(CLI::ExistingFile)->type_name("INPUT_BINARY_FILE");

// Outputs
// Metadata output regarding overlays
itk::wasm::OutputTextStream pstateOutStream;
pipeline.add_option("presentation-state-out-stream", pstateOutStream, "Output overlay information")->type_name("OUTPUT_JSON");

// Processed output image
constexpr unsigned int Dimension = 2;
using PixelType = unsigned char;
Expand All @@ -489,9 +494,6 @@ int main(int argc, char *argv[])
pipeline.add_option("output-image", outputImage, "Output image")->type_name("OUTPUT_IMAGE");

// Parameters
// addGroup "processing options:"
std::string pstateFile;
pipeline.add_option("--presentation-state-file", pstateFile, "filename: string. Process using presentation state file")->required()->check(CLI::ExistingFile)->type_name("INPUT_BINARY_FILE");
std::string configFile;
pipeline.add_option("--config-file", configFile, "filename: string. Process using settings from configuration file");
// process a specific frame within the input dicom:
Expand Down
5 changes: 2 additions & 3 deletions packages/dicom/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
"keywords": [
"itk",
"wasm",
"webassembly",
"wasi"
"webassembly"
],
"author": "",
"license": "Apache-2.0",
"dependencies": {
"itk-wasm": "^1.0.0-b.79"
"itk-wasm": "^1.0.0-b.101"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions packages/dicom/typescript/src/ReadDicomEncapsulatedPdfOptions.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/dicom/typescript/src/ReadDicomEncapsulatedPdfResult.ts

This file was deleted.

This file was deleted.

128 changes: 0 additions & 128 deletions packages/dicom/typescript/src/StructuredReportToHtmlOptions.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/dicom/typescript/src/StructuredReportToHtmlResult.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2ced230

Please sign in to comment.