File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ def _run_interface(self, runtime):
369369
370370class _IntensityClipInputSpec (BaseInterfaceInputSpec ):
371371 in_file = File (
372- exists = True , mandatory = True , desc = "file which intensity will be clipped"
372+ exists = True , mandatory = True , desc = "3D file which intensity will be clipped"
373373 )
374374 p_min = traits .Float (35.0 , usedefault = True , desc = "percentile for the lower bound" )
375375 p_max = traits .Float (99.98 , usedefault = True , desc = "percentile for the upper bound" )
@@ -519,7 +519,9 @@ def _advanced_clip(
519519 out_file = (Path (newpath or "" ) / "clipped.nii.gz" ).absolute ()
520520
521521 # Load data
522- img = nb .load (in_file )
522+ img = nb .squeeze_image (nb .load (in_file ))
523+ if len (img .shape ) != 3 :
524+ raise RuntimeError (f"<{ in_file } > is not a 3D file." )
523525 data = img .get_fdata (dtype = "float32" )
524526
525527 # Calculate stats on denoised version, to preempt outliers from biasing
You can’t perform that action at this time.
0 commit comments