Skip to content

Commit

Permalink
SimpleITKDicomImporter
Browse files Browse the repository at this point in the history
  • Loading branch information
mlavik1 committed Feb 15, 2024
1 parent 2b4bd06 commit 729f176
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void ImportSeriesInternal(ImageSequenceSeries sequenceSeries, Image imag
image = reader.Execute();

// Cast to 32-bit float
try
if (image.GetDimension() <= 3)
{
image = SimpleITK.Cast(image, PixelIDValueEnum.sitkFloat32);

Expand All @@ -140,10 +140,10 @@ private void ImportSeriesInternal(ImageSequenceSeries sequenceSeries, Image imag
IntPtr imgBuffer = image.GetBufferAsFloat();
Marshal.Copy(imgBuffer, pixelData, 0, numPixels);
}
catch
else
{
image = SimpleITK.Cast(image, PixelIDValueEnum.sitkLabelUInt8);
Debug.Log("TODO: Hacky workaround");
// TODO: Find a proper way of handling this
Debug.LogWarning("Dataset has more than 3 dimensions. Time-series are not supported. Will try to load first frame");
size = image.GetSize();

int numPixels = 1;
Expand Down

0 comments on commit 729f176

Please sign in to comment.