Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/utils/allocateImageFromChunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
import { Vector3 } from '@kitware/vtk.js/types';
import { mat3, vec3 } from 'gl-matrix';
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
import { vtkWarningMacro } from '@kitware/vtk.js/macros';

const ImagePositionPatientTag = NAME_TO_TAG.get('ImagePositionPatient')!;
const ImageOrientationPatientTag = NAME_TO_TAG.get('ImageOrientationPatient')!;
Expand Down Expand Up @@ -90,10 +89,13 @@ export function allocateImageFromChunks(sortedChunks: Chunk[]) {
? Number(meta.get(NumberOfFrames))
: null;

// If we have NumberOfFrames, chances are it's a multi-frame DICOM.
if (numberOfFrames !== null && sortedChunks.length > 1) {
vtkWarningMacro(
'Found a multi-frame chunk in a group of chunks of size > 1'
if (
numberOfFrames !== null &&
numberOfFrames > 1 &&
sortedChunks.length > 1
) {
throw new Error(
'First chunk in a group of chunks (size > 1) is a multi-frame chunk'
);
}

Expand Down
Loading