Skip to content
Merged
2 changes: 1 addition & 1 deletion packages/compare-images/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/compare-images-build",
"version": "5.4.0",
"version": "5.4.1",
"private": true,
"description": "@itk-wasm/compare-stringify build configuration",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions packages/compare-images/pixi.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
authors = ["Matt McCormick <matt@mmmccormick.com>"]
[workspace]
authors = ["Matt McCormick <matt@fideus.io>"]
channels = ["conda-forge"]
description = "Compare images with a tolerance for regression testing."
name = "compare-images"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.4.0"
__version__ = "5.4.1"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.4.0"
__version__ = "5.4.1"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.4.0"
__version__ = "5.4.1"
2 changes: 1 addition & 1 deletion packages/compare-images/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/compare-images",
"version": "5.4.0",
"version": "5.4.1",
"description": "Compare images with a tolerance for regression testing.",
"type": "module",
"module": "./dist/index.js",
Expand Down
101 changes: 52 additions & 49 deletions packages/compare-images/typescript/src/compare-double-images-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import {
InterfaceTypes,
PipelineOutput,
PipelineInput,
runPipelineNode
} from 'itk-wasm'
runPipelineNode,
} from "itk-wasm";

import CompareDoubleImagesOptions from './compare-double-images-options.js'
import CompareDoubleImagesNodeResult from './compare-double-images-node-result.js'
import CompareImagesMetric from './compare-images-metric.js'
import CompareDoubleImagesOptions from "./compare-double-images-options.js";
import CompareDoubleImagesNodeResult from "./compare-double-images-node-result.js";
import CompareImagesMetric from "./compare-images-metric.js";

import path from 'path'
import path from "path";
import { fileURLToPath } from "url";

/**
* Compare double pixel type images with a tolerance for regression testing.
Expand All @@ -22,86 +23,88 @@ import path from 'path'
*/
async function compareDoubleImagesNode(
testImage: Image,
options: CompareDoubleImagesOptions = { baselineImages: [] as Image[], }
) : Promise<CompareDoubleImagesNodeResult> {

options: CompareDoubleImagesOptions = { baselineImages: [] as Image[] }
): Promise<CompareDoubleImagesNodeResult> {
const desiredOutputs: Array<PipelineOutput> = [
{ type: InterfaceTypes.JsonCompatible },
{ type: InterfaceTypes.Image },
{ type: InterfaceTypes.Image },
]
];

const inputs: Array<PipelineInput> = [
{ type: InterfaceTypes.Image, data: testImage },
]
];

const args = []
const args = [];
// Inputs
const testImageName = '0'
args.push(testImageName as string)
const testImageName = "0";
args.push(testImageName as string);

// Outputs
const metricsName = '0'
args.push(metricsName)
const metricsName = "0";
args.push(metricsName);

const differenceImageName = '1'
args.push(differenceImageName)
const differenceImageName = "1";
args.push(differenceImageName);

const differenceUchar2dImageName = '2'
args.push(differenceUchar2dImageName)
const differenceUchar2dImageName = "2";
args.push(differenceUchar2dImageName);

// Options
args.push('--memory-io')
args.push("--memory-io");
if (typeof options.baselineImages !== "undefined") {
if(options.baselineImages.length < 1) {
throw new Error('"baseline-images" option must have a length > 1')
if (options.baselineImages.length < 1) {
throw new Error('"baseline-images" option must have a length > 1');
}
args.push('--baseline-images')
args.push("--baseline-images");

options.baselineImages.forEach((value) => {
const inputCountString = inputs.length.toString()
inputs.push({ type: InterfaceTypes.Image, data: value as Image })
args.push(inputCountString)

})
const inputCountString = inputs.length.toString();
inputs.push({ type: InterfaceTypes.Image, data: value as Image });
args.push(inputCountString);
});
}
if (typeof options.differenceThreshold !== "undefined") {
args.push('--difference-threshold', options.differenceThreshold.toString())

args.push("--difference-threshold", options.differenceThreshold.toString());
}
if (typeof options.radiusTolerance !== "undefined") {
args.push('--radius-tolerance', options.radiusTolerance.toString())

args.push("--radius-tolerance", options.radiusTolerance.toString());
}
if (typeof options.spatialTolerance !== "undefined") {
args.push('--spatial-tolerance', options.spatialTolerance.toString())

args.push("--spatial-tolerance", options.spatialTolerance.toString());
}
if (typeof options.numberOfPixelsTolerance !== "undefined") {
args.push('--number-of-pixels-tolerance', options.numberOfPixelsTolerance.toString())

args.push(
"--number-of-pixels-tolerance",
options.numberOfPixelsTolerance.toString()
);
}
if (typeof options.ignoreBoundaryPixels !== "undefined") {
options.ignoreBoundaryPixels && args.push('--ignore-boundary-pixels')
options.ignoreBoundaryPixels && args.push("--ignore-boundary-pixels");
}

const pipelinePath = path.join(path.dirname(import.meta.url.substring(7)), 'pipelines', 'compare-double-images')

const {
returnValue,
stderr,
outputs
} = await runPipelineNode(pipelinePath, args, desiredOutputs, inputs)
const pipelinePath = path.join(
path.dirname(fileURLToPath(import.meta.url)),
"pipelines",
"compare-double-images"
);

const { returnValue, stderr, outputs } = await runPipelineNode(
pipelinePath,
args,
desiredOutputs,
inputs
);
if (returnValue !== 0) {
throw new Error(stderr)
throw new Error(stderr);
}

const result = {
metrics: outputs[0].data as unknown as CompareImagesMetric,
differenceImage: outputs[1].data as Image,
differenceUchar2dImage: outputs[2].data as Image,
}
return result
};
return result;
}

export default compareDoubleImagesNode
export default compareDoubleImagesNode;
2 changes: 1 addition & 1 deletion packages/dicom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/dicom-build",
"version": "7.6.3",
"version": "7.6.4",
"private": true,
"description": "@itk-wasm/dicom build configuration.",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7.6.3"
__version__ = "7.6.4"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7.6.3"
__version__ = "7.6.4"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7.6.3"
__version__ = "7.6.4"
2 changes: 1 addition & 1 deletion packages/dicom/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/dicom",
"version": "7.6.3",
"version": "7.6.4",
"description": "Read files and images related to DICOM file format.",
"type": "module",
"module": "./dist/index.js",
Expand Down
73 changes: 40 additions & 33 deletions packages/dicom/typescript/src/read-dicom-tags-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {
InterfaceTypes,
PipelineOutput,
PipelineInput,
runPipelineNode
} from 'itk-wasm'
runPipelineNode,
} from "itk-wasm";

import ReadDicomTagsOptions from './read-dicom-tags-options.js'
import ReadDicomTagsNodeResult from './read-dicom-tags-node-result.js'
import ReadDicomTagsOptions from "./read-dicom-tags-options.js";
import ReadDicomTagsNodeResult from "./read-dicom-tags-node-result.js";


import path from 'path'
import path from "path";
import { fileURLToPath } from "url";

/**
* Read the tags from a DICOM file
Expand All @@ -23,51 +23,58 @@ import path from 'path'
async function readDicomTagsNode(
dicomFile: string,
options: ReadDicomTagsOptions = {}
) : Promise<ReadDicomTagsNodeResult> {

const mountDirs: Set<string> = new Set()
): Promise<ReadDicomTagsNodeResult> {
const mountDirs: Set<string> = new Set();

const desiredOutputs: Array<PipelineOutput> = [
{ type: InterfaceTypes.JsonCompatible },
]
];

mountDirs.add(path.dirname(dicomFile as string))
const inputs: Array<PipelineInput> = [
]
mountDirs.add(path.dirname(dicomFile as string));
const inputs: Array<PipelineInput> = [];

const args = []
const args = [];
// Inputs
const dicomFileName = dicomFile
args.push(dicomFileName as string)
const dicomFileName = dicomFile;
args.push(dicomFileName as string);

// Outputs
const tagsName = '0'
args.push(tagsName)
const tagsName = "0";
args.push(tagsName);

// Options
args.push('--memory-io')
args.push("--memory-io");
if (typeof options.tagsToRead !== "undefined") {
const inputCountString = inputs.length.toString()
inputs.push({ type: InterfaceTypes.JsonCompatible, data: options.tagsToRead as JsonCompatible })
args.push('--tags-to-read', inputCountString)

const inputCountString = inputs.length.toString();
inputs.push({
type: InterfaceTypes.JsonCompatible,
data: options.tagsToRead as JsonCompatible,
});
args.push("--tags-to-read", inputCountString);
}

const pipelinePath = path.join(path.dirname(import.meta.url.substring(7)), 'pipelines', 'read-dicom-tags')
const pipelinePath = path.join(
fileURLToPath(import.meta.url),
"..",
"pipelines",
"read-dicom-tags"
);

const {
returnValue,
stderr,
outputs
} = await runPipelineNode(pipelinePath, args, desiredOutputs, inputs, mountDirs)
const { returnValue, stderr, outputs } = await runPipelineNode(
pipelinePath,
args,
desiredOutputs,
inputs,
mountDirs
);
if (returnValue !== 0) {
throw new Error(stderr)
throw new Error(stderr);
}

const result = {
tags: outputs[0].data as [string, string][],
}
return result
};
return result;
}

export default readDicomTagsNode
export default readDicomTagsNode;
2 changes: 1 addition & 1 deletion packages/downsample/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/downsample-build",
"version": "1.8.0",
"version": "1.8.1",
"private": true,
"description": "Pipelines for downsampling images.",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.0"
__version__ = "1.8.1"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.0"
__version__ = "1.8.1"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.0"
__version__ = "1.8.1"
2 changes: 1 addition & 1 deletion packages/downsample/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itk-wasm/downsample",
"version": "1.8.0",
"version": "1.8.1",
"description": "Pipelines for downsampling images.",
"type": "module",
"module": "./dist/index.js",
Expand Down
Loading
Loading