[docs]classGIF:def__init__(self,axis:int,duration:float)->None:assertaxisin{0,1,2},"'axis' must be 0, 1 or 2."assertduration>0,"'duration' must be a positive float (in second)."self.axis=axisself.duration=durationself.reorient=tio.ToCanonical()defcreate(self,img_path:str|Path,gif_path:str|Path)->None:image=self.reorient(tio.ScalarImage(path=img_path))image.to_gif(axis=self.axis,duration=self.duration,output_path=gif_path)