示例#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
    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
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