Closed elktoe closed 6 years ago
Hi thanks for trying rivuletpy out.
It seems your pylibtiff package was not installed.
Would you pls try pip install libtiff>=0.4.1 within your conda environment?
A few questions to narrow it down: Which OS are you using? Did you install rivuletpy from the python source or using pip install rivuletpy?
In case you are doing this on windows, there was a known issue for compiling pylibtiff on windows. You can try to install a pre-compiled pylibtiff from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pylibtiff
Download the libtiff‑0.4.2‑cp35‑cp35m‑win_amd64.whl. And then run
pip install libtiff‑0.4.2‑cp35‑cp35m‑win_amd64.whl
Pls let me know if it works for you. If it does, I will add this solution to README.
Hi! Yes, I'm excited to try out rivuletpy. Im on a Mac, OSX 10.10.5 I checked before, and libtiff was installed..just not in the correct place?
I wasn't in a virtual environment before, so I set one up (0A. Setup the Anaconda environment). I followed 1. Setup the dependencies, and 2A. Install Rivuletpy from the Pypi (I'm using Anaconda).
I've gotten a different error now, see below:
$ rtrace -f 161117-870-A0.tif -t 10 RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa Traceback (most recent call last): File "//anaconda/envs/riv/bin/rtrace", line 7, in <module> from rivuletpy.trace import R2Tracer File "//anaconda/envs/riv/lib/python3.5/site-packages/rivuletpy/trace.py", line 4, in <module> import skfmm File "//anaconda/envs/riv/lib/python3.5/site-packages/skfmm/__init__.py", line 51, in <module> from .pfmm import distance, travel_time, extension_velocities File "//anaconda/envs/riv/lib/python3.5/site-packages/skfmm/pfmm.py", line 4, in <module> from .cfmm import cFastMarcher ImportError: numpy.core.multiarray failed to import
It seems that the numpy you got is not up-to-date. Can you pls try pip install -U numpy
Back to the original error. I tried your first suggestion again (pip install libtiff>=0.4.1) but am still getting the same libtiff error (see below). Thanks for you help! It is appreciated!
Traceback (most recent call last):
File "//anaconda/envs/riv/bin/rtrace", line 102, in
I also tried adding it to .bash_profile with
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH://anaconda/envs/riv/lib/python3.5/site-packages/libtiff"
I am working on a Mac, is this version of Rivulet compatible with Mac OS?
Thank-you!
I do not have a mac at hand now. However, we tested on mac before and ensured everything works well on macs.
On my linux machine, I find the compiled libtiff.so under anaconda/envs/riv/lib
instead of anaconda/envs/riv/lib/python3.5/site-packages/libtiff
Can you pls try
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH://anaconda/envs/riv/lib/"
instead? & Let's see how it goes
Tried it, same error comes up :(
Interesting. Not sure why the compiled libtiff is not found.
How about trying to install the mac compiled libtiff with brew
brew install libtiff
I have actually experienced the same problem as elktoe when I tried to install libtiff on my current Mac workstation, this can be solved perfectly with mac compiled libtiff with brew. Make sure you get rid of the previous not working libtiff module before you install mac compiled libtiff
pip3 uninstall libtiff
then
brew install libtiff
as suggested by @lsqshr, see if it works.
@jackjacktang Thanks for the note Jack. This is helpful! If this is working, I will add it to README.
Yup, brew install libtiff
worked for me.
A couple quick questions. How long does it usually take to make a trace (for example image size 512x512x40)
Also, unless you specify the name of the output file (-o
) or to view the reconstructed trace (-v
), nothing will be saved? I ran a test trace and at the end no output files were created (unless they are in a folder I can't find). Just checking that this usually how rivuletpy runs and that I need to specify an output file. And the output is a .swc file?
thanks for your help!
Great to know such a workaround. I will add it in our README
The running time of rivulet2 algorithm depends on both the image size (fast marching) as well as the number of foreground voxels (back-tracking). A volume with 512x512x40 is sort of large but I guess it would finish within 5 mins. For most of the images, we would add a -z 0.7
to speed up the tracing by downsampling the image. Then such an image would finish within around 2 mins.
Suppose you are trying to trace /SOMEPATH/image.tif and do not specify -o
, it should output a swc at /SOMEPATH/image.tif.r2.swc
Hi! How could I solve this problem if I was in anaconda virtual envs?(without using brew)
@Red-scarf-0317 thanks for reaching out. can you share a bit more details: (1) what is the exact error msg you are seeing? (2) which OS system you are using (MAC/Windows/Linux)?
Hi, im on a virtual environment and when I run pip install libtiff I get this error, ( No module named 'numpy' ) even though I installed numpy and used it and double checked its installed. Im on MacOS 14.3.1 and PYTHON 3.12.2
Hi, had this issue come up the first time I tried rtrace
File "//anaconda/lib/python3.5/site-packages/libtiff/libtiff_ctypes.py", line 46, in
raise ImportError('Failed to find TIFF library. Make sure that libtiff '
ImportError: Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..
Thanks!