We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c65a98 commit 8ee623fCopy full SHA for 8ee623f
petdeface/pet.py
@@ -55,6 +55,14 @@ def _run_interface(self, runtime):
55
frames_duration = np.array(meta.outputs.out_dict["FrameDuration"])
56
57
mid_frames = frames_start + frames_duration / 2
58
+
59
+ # check to see if the json sidecar file has the correct number of frames
60
+ if len(mid_frames) != data.shape[-1]:
61
+ json_file = pet_file.replace(".gz", "").replace(".nii", ".json")
62
+ raise ValueError(
63
+ f"Number of frames in {pet_file} does not match the number of frames in the json sidecar file {json_file}"
64
+ )
65
66
wavg = np.trapz(data, x=mid_frames) / (mid_frames[-1] - mid_frames[0])
67
68
_, base, ext = split_filename(pet_file)
0 commit comments