Skip to content

Commit 17bca17

Browse files
committed
fix(InterfaceTypes): consistent default name
1 parent 7b4f245 commit 17bca17

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

include/itkImageJSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace itk
5656
{
5757
ImageTypeJSON imageType;
5858

59-
std::string name { "image" };
59+
std::string name { "Image" };
6060

6161
std::vector<double> origin { 0.0, 0.0 };
6262
std::vector<double> spacing { 1.0, 1.0 };

include/itkMeshJSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace itk
6060
{
6161
MeshTypeJSON meshType;
6262

63-
std::string name { "mesh"};
63+
std::string name { "Mesh"};
6464

6565
size_t numberOfPoints{ 0 };
6666
std::string points;

include/itkPolyDataJSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace itk
5757
{
5858
PolyDataTypeJSON polyDataType;
5959

60-
std::string name { "polydata" };
60+
std::string name { "PolyData" };
6161

6262
size_t numberOfPoints{ 0 };
6363
std::string points;

packages/core/typescript/itk-wasm/src/interface-types/image.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import setMatrixElement from '../set-matrix-element.js'
44
import Metadata from './metadata.js'
55

66
class Image {
7-
name: string = 'image'
7+
name: string = 'Image'
88

99
origin: number[]
1010

@@ -18,7 +18,7 @@ class Image {
1818

1919
data: null | TypedArray
2020

21-
constructor(public readonly imageType = new ImageType()) {
21+
constructor (public readonly imageType = new ImageType()) {
2222
const dimension = imageType.dimension
2323
this.origin = new Array(dimension)
2424
this.origin.fill(0.0)

packages/core/typescript/itk-wasm/src/interface-types/mesh-type.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import FloatTypes from './float-types.js'
33
import PixelTypes from './pixel-types.js'
44

55
class MeshType {
6-
constructor(
6+
constructor (
77
public readonly dimension: number = 2,
88
public readonly pointComponentType: (typeof FloatTypes)[keyof typeof FloatTypes] = FloatTypes.Float32,
99
public readonly pointPixelComponentType:
10-
| (typeof IntTypes)[keyof typeof IntTypes]
11-
| (typeof FloatTypes)[keyof typeof FloatTypes] = FloatTypes.Float32,
10+
| (typeof IntTypes)[keyof typeof IntTypes]
11+
| (typeof FloatTypes)[keyof typeof FloatTypes] = FloatTypes.Float32,
1212
public readonly pointPixelType: (typeof PixelTypes)[keyof typeof PixelTypes] = PixelTypes.Scalar,
1313
public readonly pointPixelComponents: number = 1,
1414
public readonly cellComponentType: (typeof IntTypes)[keyof typeof IntTypes] = IntTypes.Int32,
1515
public readonly cellPixelComponentType:
16-
| (typeof IntTypes)[keyof typeof IntTypes]
17-
| (typeof FloatTypes)[keyof typeof FloatTypes] = FloatTypes.Float32,
16+
| (typeof IntTypes)[keyof typeof IntTypes]
17+
| (typeof FloatTypes)[keyof typeof FloatTypes] = FloatTypes.Float32,
1818
public readonly cellPixelType: (typeof PixelTypes)[keyof typeof PixelTypes] = PixelTypes.Scalar,
1919
public readonly cellPixelComponents: number = 1
2020
) {}

packages/core/typescript/itk-wasm/src/interface-types/mesh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import MeshType from './mesh-type.js'
22
import type TypedArray from '../typed-array.js'
33

44
class Mesh {
5-
name: string = 'mesh'
5+
name: string = 'Mesh'
66

77
numberOfPoints: number
88
points: null | TypedArray
@@ -17,7 +17,7 @@ class Mesh {
1717
numberOfCellPixels: number
1818
cellData: null | TypedArray
1919

20-
constructor(public readonly meshType = new MeshType()) {
20+
constructor (public readonly meshType = new MeshType()) {
2121
this.name = 'mesh'
2222

2323
this.numberOfPoints = 0

packages/core/typescript/itk-wasm/src/interface-types/poly-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PolyDataType from './poly-data-type.js'
22
import TypedArray from '../typed-array.js'
33

44
class PolyData {
5-
name: string = 'polydata'
5+
name: string = 'PolyData'
66

77
numberOfPoints: number
88
points: Float32Array
@@ -28,7 +28,7 @@ class PolyData {
2828
constructor(public readonly polyDataType = new PolyDataType()) {
2929
this.polyDataType = polyDataType
3030

31-
this.name = 'polydata'
31+
this.name = 'PolyData'
3232

3333
this.numberOfPoints = 0
3434
this.points = new Float32Array()

packages/core/typescript/itk-wasm/test/node/interface-types/image-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import test from 'ava'
22

33
import { Image, ImageType, IntTypes } from '../../../dist/index-node.js'
44

5-
test('imageType should have the same imageType passed to the constructor', t => {
5+
test('imageType should have the same imageType passed to the constructor', (t) => {
66
const image = new Image()
77
const defaultImageType = new ImageType()
88
t.deepEqual(image.imageType, defaultImageType)
99
})
1010

11-
test('name should have the default value of "Image"', t => {
11+
test('name should have the default value of "Image"', (t) => {
1212
const image = new Image()
13-
t.deepEqual(image.name, 'image')
13+
t.deepEqual(image.name, 'Image')
1414
})
1515

16-
test('origin should have a length equal to the dimension', t => {
16+
test('origin should have a length equal to the dimension', (t) => {
1717
let imageType = new ImageType(2, IntTypes.UInt8)
1818
let image = new Image(imageType)
1919
t.is(image.origin.length, 2)
@@ -23,13 +23,13 @@ test('origin should have a length equal to the dimension', t => {
2323
t.is(image.origin.length, 3)
2424
})
2525

26-
test('origin should have a default value of 0.0', t => {
26+
test('origin should have a default value of 0.0', (t) => {
2727
const imageType = new ImageType(2, IntTypes.UInt8)
2828
const image = new Image(imageType)
2929
t.is(image.origin[0], 0.0)
3030
})
3131

32-
test('spacing should have a length equal to the dimension', t => {
32+
test('spacing should have a length equal to the dimension', (t) => {
3333
let imageType = new ImageType(2, IntTypes.UInt8)
3434
let image = new Image(imageType)
3535
t.is(image.spacing.length, 2)
@@ -39,13 +39,13 @@ test('spacing should have a length equal to the dimension', t => {
3939
t.is(image.spacing.length, 3)
4040
})
4141

42-
test('spacing should have a default value of 1.0', t => {
42+
test('spacing should have a default value of 1.0', (t) => {
4343
const imageType = new ImageType(2, IntTypes.UInt8)
4444
const image = new Image(imageType)
4545
t.is(image.spacing[0], 1.0)
4646
})
4747

48-
test('direction should be the identity by default', t => {
48+
test('direction should be the identity by default', (t) => {
4949
const imageType = new ImageType(2)
5050
const image = new Image(imageType)
5151
t.is(image.direction[0], 1.0)
@@ -54,7 +54,7 @@ test('direction should be the identity by default', t => {
5454
t.is(image.direction[3], 1.0)
5555
})
5656

57-
test('size should have a length equal to the dimension', t => {
57+
test('size should have a length equal to the dimension', (t) => {
5858
let imageType = new ImageType(2)
5959
let image = new Image(imageType)
6060
t.is(image.size.length, 2)
@@ -64,19 +64,19 @@ test('size should have a length equal to the dimension', t => {
6464
t.is(image.size.length, 3)
6565
})
6666

67-
test('size should have a default value of 0', t => {
67+
test('size should have a default value of 0', (t) => {
6868
const imageType = new ImageType(2)
6969
const image = new Image(imageType)
7070
t.is(image.size[0], 0)
7171
})
7272

73-
test('metadata should be an object', t => {
73+
test('metadata should be an object', (t) => {
7474
const imageType = new ImageType(2)
7575
const image = new Image(imageType)
7676
t.is(typeof image.metadata, 'object')
7777
})
7878

79-
test('data should have a default value of null', t => {
79+
test('data should have a default value of null', (t) => {
8080
const imageType = new ImageType(2)
8181
const image = new Image(imageType)
8282
t.is(image.data, null)

packages/core/typescript/itk-wasm/test/node/interface-types/poly-data-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ import test from 'ava'
22

33
import { PolyData } from '../../../dist/index-node.js'
44

5-
test('name should have the default value of "PolyData"', t => {
5+
test('name should have the default value of "PolyData"', (t) => {
66
const polyData = new PolyData()
77
t.deepEqual(polyData.name, 'PolyData')
88
})
99

10-
test('points should be a Float32Array', t => {
10+
test('points should be a Float32Array', (t) => {
1111
const polyData = new PolyData()
1212
t.assert(polyData.points instanceof Float32Array)
1313
})
1414

15-
test('points should have a default length of 0', t => {
15+
test('points should have a default length of 0', (t) => {
1616
const polyData = new PolyData()
1717
t.is(polyData.points.length, 0)
1818
})
1919

20-
test('lines should have a default value of null', t => {
20+
test('lines should have a default value of null', (t) => {
2121
const polyData = new PolyData()
2222
t.is(polyData.lines, null)
2323
})
2424

25-
test('vertices should have a default value of null', t => {
25+
test('vertices should have a default value of null', (t) => {
2626
const polyData = new PolyData()
2727
t.is(polyData.vertices, null)
2828
})
2929

30-
test('polygons should have a default value of null', t => {
30+
test('polygons should have a default value of null', (t) => {
3131
const polyData = new PolyData()
3232
t.is(polyData.polygons, null)
3333
})
3434

35-
test('triangleStrips should have a default value of null', t => {
35+
test('triangleStrips should have a default value of null', (t) => {
3636
const polyData = new PolyData()
3737
t.is(polyData.triangleStrips, null)
3838
})

0 commit comments

Comments
 (0)