コード例 #1
0
    def _make_writer(self, filename):
        "Internal function."
        extension = None
        parts = filename.split('.')
        if len(parts) > 1:
            extension = parts[-1]
        else:
            raise RuntimeError(
                "Filename has no extension, cannot guess writer to use")

        if extension == 'png':
            return vtkPNGWriter()
        elif extension == 'bmp':
            return vtkBMPWriter()
        elif extension == 'ppm':
            return vtkPNMWriter()
        elif extension == 'tif' or extension == 'tiff':
            return vtkTIFFWriter()
        elif extension == 'jpg' or extension == 'jpeg':
            return vtkJPEGWriter()
        elif extension == 'vti':
            return vtkXMLImageDataWriter()  # noqa: F821
        else:
            raise RuntimeError("Cannot infer filetype from extension:",
                               extension)
コード例 #2
0
ファイル: raster_wrangler.py プロジェクト: Kitware/ParaView
    def _make_writer(self, filename):
        "Internal function."
        extension = None
        parts = filename.split('.')
        if len(parts) > 1:
            extension = parts[-1]
        else:
            raise RuntimeError(
                "Filename has no extension, cannot guess writer to use")

        if extension == 'png':
            return vtkPNGWriter()
        elif extension == 'bmp':
            return vtkBMPWriter()
        elif extension == 'ppm':
            return vtkPNMWriter()
        elif extension == 'tif' or extension == 'tiff':
            return vtkTIFFWriter()
        elif extension == 'jpg' or extension == 'jpeg':
            return vtkJPEGWriter()
        elif extension == 'vti':
            return vtkXMLImageDataWriter()  # noqa: F821
        else:
            raise RuntimeError(
                "Cannot infer filetype from extension:", extension)
コード例 #3
0
ファイル: raster_wrangler.py プロジェクト: yijiang1/ParaView
def _make_writer(filename):
    "Internal function."
    extension = None
    parts = filename.split('.')
    if len(parts) > 1:
        extension = parts[-1]
    else:
        raise RuntimeError, "Filename has no extension, please specify a write"

    if extension == 'png':
        return vtkPNGWriter()
    elif extension == 'bmp':
        return vtkBMPWriter()
    elif extension == 'ppm':
        return vtkPNMWriter()
    elif extension == 'tif' or extension == 'tiff':
        return vtkTIFFWriter()
    elif extension == 'jpg' or extension == 'jpeg':
        return vtkJPEGWriter()
    else:
        raise RuntimeError, "Cannot infer filetype from extension:", extension
コード例 #4
0
def _make_writer(filename):
    "Internal function."
    extension = None
    parts = filename.split('.')
    if len(parts) > 1:
        extension = parts[-1]
    else:
        raise RuntimeError, "Filename has no extension, please specify a write"

    if extension == 'png':
        return vtkPNGWriter()
    elif extension == 'bmp':
        return vtkBMPWriter()
    elif extension == 'ppm':
        return vtkPNMWriter()
    elif extension == 'tif' or extension == 'tiff':
        return vtkTIFFWriter()
    elif extension == 'jpg' or extension == 'jpeg':
        return vtkJPEGWriter()
    else:
        raise RuntimeError, "Cannot infer filetype from extension:", extension