parameters: (
      image_or_filter: "itkt.ImageOrImageSource",
      filename: fileiotype,
      compression: bool = False,
      imageio: Optional["itkt.ImageIOBase"] = None,
  )
docstring: Write a image or the output image of a filter to a file.
  
      Parameters
      ----------
  
      image_or_filter :
          Image or filter that produces an image to write to the file.
  
      filename :
          Target output file path.
  
      compression :
          Use compression when writing if the format supports it.
  
      imageio :
          Use the provided itk.ImageIOBase derived instance to write the file.
  
      The writer is instantiated with the image type of the image in
      parameter (or, again, with the output image of the filter in parameter).
docstring_summary: Write a image or the output image of a filter to a file.
docstring_tokens: Write a image or the output image of a filter to a file .
function: def imwrite(
      image_or_filter: "itkt.ImageOrImageSource",
      filename: fileiotype,
      compression: bool = False,
      imageio: Optional["itkt.ImageIOBase"] = None,
  ) -> None:
      """Write a image or the output image of a filter to a file.
  
      Parameters
      ----------
  
      image_or_filter :
          Image or filter that produces an image to write to the file.
  
      filename :
          Target output file path.
  
      compression :
          Use compression when writing if the format supports it.
  
      imageio :
          Use the provided itk.ImageIOBase derived instance to write the file.
  
      The writer is instantiated with the image type of the image in
      parameter (or, again, with the output image of the filter in parameter).
      """
      import itk
  
      img = itk.output(image_or_filter)
      img.UpdateOutputInformation()
      # don't put that writer in the automatic pipeline
      tmp_auto_pipeline = auto_pipeline.current
      auto_pipeline.current = None
      writer = itk.ImageFileWriter[type(img)].New(
          Input=img, FileName=f"{filename}", UseCompression=compression
      )
      auto_pipeline.current = tmp_auto_pipeline
      if imageio:
          writer.SetImageIO(imageio)
      writer.Update()
function_tokens: def imwrite ( image_or_filter : "itkt.ImageOrImageSource" , filename : fileiotype , compression : bool = False , imageio : Optional [ "itkt.ImageIOBase" ] = None , ) -> None : import itk img = itk . output ( image_or_filter ) img . UpdateOutputInformation ( ) # don't put that writer in the automatic pipeline tmp_auto_pipeline = auto_pipeline . current auto_pipeline . current = None writer = itk . ImageFileWriter [ type ( img ) ] . New ( Input = img , FileName = f"{filename}" , UseCompression = compression ) auto_pipeline . current = tmp_auto_pipeline if imageio : writer . SetImageIO ( imageio ) writer . Update ( )