Skip to content

Commit 5009854

Browse files
committed
Removed dataaset downsample WIP code (committed by accident) + some unused code.
1 parent 8e09863 commit 5009854

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

Assets/Scripts/Importing/DICOMImporter.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ public VolumeDataset ImportDICOMSeries(DICOMSeries series)
116116
return null;
117117
}
118118

119-
float minLoc = (float)files[0].location;
120-
float maxLoc = (float)files[files.Count - 1].location;
121-
float locRange = maxLoc - minLoc;
122-
123119
// Create dataset
124120
VolumeDataset dataset = new VolumeDataset();
125121
dataset.datasetName = Path.GetFileName(datasetName);
@@ -153,35 +149,6 @@ public VolumeDataset ImportDICOMSeries(DICOMSeries series)
153149
}
154150
}
155151

156-
int MAX_DIM = 2048;
157-
158-
if (Mathf.Max(dataset.dimX, dataset.dimY, dataset.dimZ) > MAX_DIM)
159-
{
160-
Debug.Log("Downsampling dataset");
161-
162-
int dimX = Mathf.Min(dataset.dimX, MAX_DIM);
163-
int dimY = Mathf.Min(dataset.dimY, MAX_DIM);
164-
int dimZ = Mathf.Min(dataset.dimZ, MAX_DIM);
165-
int[] data = new int[dimX * dimY * dimZ];
166-
167-
for (int z = 0; z < dimZ; z++)
168-
{
169-
for (int y = 0; y < dimY; y++)
170-
{
171-
for (int x = 0; x < dimX; x++)
172-
{
173-
int oldIndex = (z * dataset.dimX * dataset.dimY) + (y * dataset.dimX) + x;
174-
int newIndex = (z * dimX * dimY) + (y * dimX) + x;
175-
data[newIndex] = dataset.data[oldIndex];
176-
}
177-
}
178-
}
179-
dataset.data = data;
180-
dataset.dimX = dimX;
181-
dataset.dimY = dimY;
182-
dataset.dimZ = dimZ;
183-
}
184-
185152
if (files[0].pixelSpacing > 0.0f)
186153
{
187154
dataset.scaleX = files[0].pixelSpacing * dataset.dimX;

0 commit comments

Comments
 (0)