Remove libtiff
This commit is contained in:
parent
a18b669437
commit
94e01e240d
@ -12,7 +12,7 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import libtiff
|
from .CreaTIFF import read, write
|
||||||
|
|
||||||
class Triskele:
|
class Triskele:
|
||||||
def __init__(self, raster, dtype=np.uint8, cache_dir='/tmp', verbose=True):
|
def __init__(self, raster, dtype=np.uint8, cache_dir='/tmp', verbose=True):
|
||||||
@ -43,7 +43,7 @@ class Triskele:
|
|||||||
return self._read_outfile()
|
return self._read_outfile()
|
||||||
|
|
||||||
def _read_outfile(self):
|
def _read_outfile(self):
|
||||||
return libtiff.TIFF.open(self.outfile).read_image()
|
return read(self.outfile)
|
||||||
|
|
||||||
def _write_infile(self, raster, dtype):
|
def _write_infile(self, raster, dtype):
|
||||||
## Scale to new dtype
|
## Scale to new dtype
|
||||||
@ -54,8 +54,7 @@ class Triskele:
|
|||||||
raster *= (rep.max - rep.min) / (raster.max() - raster.min())
|
raster *= (rep.max - rep.min) / (raster.max() - raster.min())
|
||||||
raster = raster.astype(dtype)
|
raster = raster.astype(dtype)
|
||||||
|
|
||||||
tif = libtiff.TIFFimage(raster, description='TRISKELE Python wrapper')
|
write(self.infile, raster)
|
||||||
tif.write_file(self.infile, verbose=self.verbose, compression=None) # 'lzw'
|
|
||||||
|
|
||||||
def _setup(self, tree, area, standard_deviation, moment_of_inertia):
|
def _setup(self, tree, area, standard_deviation, moment_of_inertia):
|
||||||
self.process = [self.triskele_bin,
|
self.process = [self.triskele_bin,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user