Skip to content

Commit 9e0404a

Browse files
authored
patch-neural-representation update + bug fix related to differences in image and patch spacing (#52)
1 parent 84974c1 commit 9e0404a

3 files changed

Lines changed: 68 additions & 32 deletions

File tree

Lines changed: 66 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,69 @@
11
[
2-
{
3-
"meta": {
4-
"spacing": [0.5, 0.5, 1],
5-
"patch-size": [224, 224, 3]
6-
},
7-
"patches": [
8-
{
9-
"features": [
10-
0.345,
11-
0.234
12-
],
13-
"coordinates": [
14-
1,
15-
2,
16-
3
17-
]
18-
},
19-
{
20-
"features": [
21-
0.234,
22-
0.623
23-
],
24-
"coordinates": [
25-
1,
26-
2,
27-
3
28-
]
29-
}
2+
{
3+
"meta": {
4+
"image-size": [
5+
640,
6+
640,
7+
31
8+
],
9+
"patch-size": [
10+
224,
11+
224,
12+
16
13+
],
14+
"image-origin": [
15+
-109.22891616821,
16+
-76.614260508237,
17+
-84.293114437337
18+
],
19+
"image-spacing": [
20+
0.28125,
21+
0.28125,
22+
3.2999999825580133
23+
],
24+
"patch-spacing": [
25+
0.5,
26+
0.5,
27+
1.0
28+
],
29+
"image-direction": [
30+
1.0,
31+
0.0,
32+
0.0,
33+
0.0,
34+
0.9198214989417033,
35+
0.3923371128056057,
36+
0.0,
37+
-0.3923371128056057,
38+
0.9198214989417033
39+
]
40+
},
41+
"title": "transverse-t2-prostate-mri",
42+
"patches": [
43+
{
44+
"features": [
45+
318.71170479910717,
46+
230.66145469236733,
47+
345.0
3048
],
31-
"title": "generic-medical-image"
32-
}
49+
"coordinates": [
50+
-113.72891616821,
51+
-80.75345725347466,
52+
-82.52759742971178
53+
]
54+
},
55+
{
56+
"features": [
57+
246.62460887675383,
58+
200.84204573309574,
59+
265.0
60+
],
61+
"coordinates": [
62+
-113.72891616821,
63+
-60.0380578068289,
64+
-33.961022542286074
65+
]
66+
}
67+
]
68+
}
3369
]

src/unicorn_baseline/vision/radiology/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def extract_features_segmentation(
8888
image = sitk.DICOMOrient(image, desiredCoordinateOrientation="LPS")
8989

9090
print(f"Extracting patches from image")
91-
patches, coordinates = extract_patches(
91+
patches, coordinates, image = extract_patches(
9292
image=image,
9393
patch_size=patch_size,
9494
spacing=patch_spacing,

src/unicorn_baseline/vision/radiology/patch_extraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ def extract_patches(
8787
)
8888
coordinates.append(world_coordinates)
8989

90-
return patches, coordinates
90+
return patches, coordinates, image

0 commit comments

Comments
 (0)