Skip to content

Commit

Permalink
refactor: deprecate mesh-to-poly-data and point to new package
Browse files Browse the repository at this point in the history
Following InsightSoftwareConsortium#716

BREAKING_CHANGE: meshToPolyData, meshToPolyDataNode, polyDataToMesh, polyDataToMeshNode have been migrated to @itk-wasm/mesh-to-poly-data
  • Loading branch information
thewtex committed Dec 14, 2023
1 parent 277c6c3 commit e72bdb1
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 123 deletions.
1 change: 1 addition & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ guide](doc/content/docs/itk_js_to_itk_wasm_migration_guide.md).
- readImageDICOMFileSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeries
- readImageDICOMArrayBufferSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeries
- readImageLocalDICOMFileSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeriesNode
- meshToPolyData, meshToPolyDataNode, polyDataToMesh, polyDataToMeshNode have been migrated to @itk-wasm/mesh-to-poly-data

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

Expand Down
19 changes: 14 additions & 5 deletions docs/development/itk_js_to_itk_wasm_migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,20 @@ An example that vendors these package's webassembly assets into an application f
The following DICOM image IO functions have been migrated to the `@itk-wasm/dicom` package. Their interface changed in some cases.

1. `readImageLocalDICOMFileSeries` -> `readImageDicomFileSeriesNode`
1. `readImageDICOMFileSeries` -> `readImageDicomFileSeries`
1. `readImageDICOMArrayBufferSeries` -> `readImageDicomFileSeries`
1. `readDICOMTags` -> `readDicomTags`
1. `readDICOMTagsArrayBuffer` -> `readDicomTags`
1. `readDICOMTagsLocalFile` -> `readDicomTagsNode`
2. `readImageDICOMFileSeries` -> `readImageDicomFileSeries`
3. `readImageDICOMArrayBufferSeries` -> `readImageDicomFileSeries`
4. `readDICOMTags` -> `readDicomTags`
5. `readDICOMTagsArrayBuffer` -> `readDicomTags`
6. `readDICOMTagsLocalFile` -> `readDicomTagsNode`

### MeshToPolyData

The following mesh to polydata conversion functions have been migrated to the `@itk-wasm/mesh-to-poly-data` package.

1. `meshToPolyData`
2. `meshToPolyDataNode`
3. `polyDataToMesh`
4. `polyDataToMeshNode`

## CLI options

Expand Down
11 changes: 10 additions & 1 deletion packages/core/typescript/itk-wasm/src/deprecated/index-node.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
import readDICOMTagsLocalFile from './read-dicom-tags-local-file.js'
import readDICOMTagsLocalFile from "./read-dicom-tags-local-file.js"
export { readDICOMTagsLocalFile }

import readImageLocalDICOMFileSeries from "./read-image-local-dicom-file-series.js"
export { readImageLocalDICOMFileSeries }

import meshToPolyDataNode from "./mesh-to-poly-data-node.js"
export { meshToPolyDataNode }

import polyDataToMeshNode from "./poly-data-to-mesh-node.js"
export { polyDataToMeshNode }
16 changes: 11 additions & 5 deletions packages/core/typescript/itk-wasm/src/deprecated/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import ReadDICOMTagsResult from './read-dicom-tags-result.js'
export type { ReadDICOMTagsResult }

import readDICOMTags from './read-dicom-tags.js'
export { readDICOMTags }

import readDICOMTagsArrayBuffer from './read-dicom-tags-array-buffer.js'
export { readDICOMTagsArrayBuffer }

import readImageDICOMFileSeries from './read-image-dicom-file-series.js'
export { readImageDICOMFileSeries }

import ReadImageDICOMFileSeriesResult from './read-image-dicom-file-series-result.js'
export type { ReadImageDICOMFileSeriesResult }

import readImageDICOMArrayBufferSeries from './read-image-dicom-array-buffer-series.js'
export type { ReadDICOMTagsResult }
export { readDICOMTags }
export { readDICOMTagsArrayBuffer }
export { readImageDICOMFileSeries }
export type { ReadImageDICOMFileSeriesResult }
export { readImageDICOMArrayBufferSeries }

import meshToPolyData from './mesh-to-poly-data.js'
export { meshToPolyData }

import polyDataToMesh from './poly-data-to-mesh.js'
export { polyDataToMesh }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-nocheck

import Mesh from '../interface-types/mesh.js'
import PolyData from '../interface-types/poly-data.js'


/**
* @deprecated Use meshToPolyDataNode from @itk-wasm/mesh-to-poly-data instead
*/
async function meshToPolyDataNode (mesh: Mesh): Promise<PolyData> {
throw new Error('This function has been migrated to the @itk-wasm/mesh-to-poly-data package.')
}

export default meshToPolyDataNode
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @ts-nocheck

import Mesh from '../interface-types/mesh.js'
import PolyData from '../interface-types/poly-data.js'

/**
* @deprecated Use meshToPolyData from @itk-wasm/mesh-to-poly-data instead
*/
async function meshToPolyData (webWorker: Worker | null, mesh: Mesh): Promise<{ polyData: PolyData, webWorker: Worker }> {
throw new Error('This function has been migrated to the @itk-wasm/mesh-to-poly-data package.')
}

export default meshToPolyData
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import path from 'path'
// @ts-nocheck

import Mesh from '../core/interface-types/mesh.js'
import PolyData from '../core/interface-types/poly-data.js'
import findLocalMeshIOPath from './internal/findLocalMeshIOPath.js'
import InterfaceTypes from '../core/InterfaceTypes.js'
import PipelineInput from '../pipeline/PipelineInput.js'
import loadEmscriptenModule from './../core/internal/loadEmscriptenModuleNode.js'
import runPipelineEmscripten from '../pipeline/internal/runPipelineEmscripten.js'
import PipelineEmscriptenModule from '../pipeline/PipelineEmscriptenModule.js'
import Mesh from '../interface-types/mesh.js'
import PolyData from '../interface-types/poly-data.js'


/**
* @deprecated Use polyDataToMeshNode from @itk-wasm/mesh-to-poly-data instead
*/
async function polyDataToMeshNode (polyData: PolyData): Promise<Mesh> {
const meshIOsPath = findLocalMeshIOPath()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-nocheck

import Mesh from '../interface-types/mesh.js'
import PolyData from '../interface-types/poly-data.js'


/**
* @deprecated Use polyDataToMesh from @itk-wasm/mesh-to-poly-data instead
*/
async function polyDataToMesh (webWorker: Worker | null, polyData: PolyData): Promise<{ mesh: Mesh, webWorker: Worker }> {
throw new Error('This function has been migrated to the @itk-wasm/mesh-to-poly-data package.')
}

export default polyDataToMesh
37 changes: 0 additions & 37 deletions src/io/meshToPolyData.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/io/meshToPolyDataNode.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/io/polyDataToMesh.ts

This file was deleted.

0 comments on commit e72bdb1

Please sign in to comment.