John Cupitt
John Cupitt
Actually I'm not sure pyvips had this bug, I think it was just the vips CLI. I tried: ``` $ git checkout v8.9.0 $ CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" ./autogen.sh --prefix=/home/john/vips...
Hi @SikangSHU, You have: ```python image = pyvips.Image.arrayjoin(patch, across=img.width) ``` Try `n_across` instead. Why are you cropping and joining the image? I don't think you need to do this.
I made you a demo program: ```python #!/usr/bin/python3 import sys import pyvips import numpy as np def process_tile(patch): """pass a pyvips image through numpy """ # make a numpy array...
I'd like to try implementing colour deconvolution in libvips. Do you have a sample image I could experiment with?
Just a section would be fine. As long as it shows all three stains.
This is sort-of working: ```python #!/usr/bin/python3 import sys import pyvips image = pyvips.Image.new_from_file(sys.argv[1]) # scale to 0-1 image /= 256 # set of stains we deconvolve with stain_vectors = pyvips.Image.new_from_array([...
Just save as a pyramidal tiff. Try: ```python filename = f"stain-{i}.tif[tile,compression=jpeg,pyramid]" ```
Slightly improved version (now uses scrgb space): ```python #!/usr/bin/python3 import sys import pyvips image = pyvips.Image.new_from_file(sys.argv[1]) # transform to linear 0-1 image = image.colourspace("scrgb") # set of stains we deconvolve...
I agree, it's not working well and I'm not sure why. I might take another look later today if I have time.
You're right, there's something funny about the pyvips matrix invert. If works if you use the numpy invert: ```python3 #!/usr/bin/python3 import sys import pyvips import numpy as np from numpy...