MathOnco / valis

Virtual Alignment of pathoLogy Image Series
https://valis.readthedocs.io/en/latest/
MIT License
117 stars 28 forks source link

Not producing output #143

Open dr-sayyadhury opened 1 month ago

dr-sayyadhury commented 1 month ago

Dear Chandler,

I really do like your package but unfortuatnely i have never been able to get it runnign smoothly and this image registration is very ciritical to my project. I have opened several requests and as much as I am so happy to have such a responsive developer such as yourself, I cannot be running into issues each time i come back and do a system update and i can't even track what's wrong.

The latest issue is with running valis itself.

As soon as I run the following

create a Valis object

registrar = registration.Valis(slide_src_dir, results_dst_dir) rigid_registrar, non_regid_registrar, error_df = registrar.register()

I get the folllwijg output: SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. JVM has been initialized. Be sure to call registration.kill_jvm() or slide_io.kill_jvm() at the end of your script.

==== Converting images

And yes as much as you indicated that the SLF4J error is not important, my process gets stuck atthe "converting images" section.


I understand programs can have bugs and image analysis is very problematic but I do need a solution as I have septn months solving just one problem after another and now suddenly i encounter this probelm when i thought I had fixed everything.

Is it better to run valis on my mac instead of ubuntu? Do you think that will help?

Thank you.

Regards, Shamini A

cdgatenbee commented 1 month ago

Hi @dr-sayyadhury, Sorry you keep running into issues, but thank you for your patience. Since there isn't any output after the "==== Converting images" message, could you share some more information with me so I can try to figure out what is causing your program to freeze? What file format are you using (.tif, .czi, .ome.tiff, etc...)? Is the "processed" folder created, and is there anything in it? Which version of valis are you using? Do the examples work for you? Are you using a dedicated virtual environment? If not, did a particular package update result in valis not working anymore? Finally, would it be possible to share some images, so that I could try to replicate this?

Regarding your question about running valis on mac instead of ubuntu, it certainly wouldn't hurt to try. While valis does get tested on mac, linux, and windows, it could be that those tests are not catching the issue you are having. Another option could be to try using the Docker container, which has the additional benefit that it shouldn't be affected by any system or package updates you make.

Best, -Chandler

dr-sayyadhury commented 1 month ago

Dear Chandler,

Actually I am also surprised that it didn’t work.

These are my responses to your questions below.

  1. Recently my conda environment failed as a result of my ubuntu os crashing. So I created a new conda env with python 3.12. However valis 1.1.0 did not want to install. So I downgraded it to 1.0.4. I thought maybe that was an issue
  2. However valis 1.0.4 also kept showing me the same frozen output. I created new conda env with python 3.9, 3.10 and it just kept freezing.
  3. I tried running the code with and without creating the results and registered folders and it keeps freezing.

The only issue I can think of is that my system kept crashing for awhile but my RA fixed my VM for me and I just ran the code a few week ago if you re call- you helped me with aligning my segmentation coordinates with my images.

Sorry for the messahe but I thought I got everything working the last time so I am not sure why suddenly I am having issues.

I will send you my images in a separate email but I will also follow your advice and use docker to run my images.

Thank you and my apologies.

With warm regards, Shamini Ayyadhury , PhD Postdoctoral Fellow from the Bader and Pugh Labs University of Toronto, University Health Network Discovering Hierarchical Architectural Patterning in GBM with Computer Vision, Spatial Technologies and AI

Senior Data Scientist | Pathomics.io, Director | Panoramics, A Vision https://linktr.ee/dr_mystique27m

From: Chandler Gatenbee @.> Date: Monday, July 22, 2024 at 12:27 PM To: MathOnco/valis @.> Cc: Shamini Ayyadhury @.>, Mention @.> Subject: Re: [MathOnco/valis] Not producing output (Issue #143) You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Hi @dr-sayyadhuryhttps://github.com/dr-sayyadhury, Sorry you keep running into issues, but thank you for your patience. Since there isn't any output after the "==== Converting images" message, could you share some more information with me so I can try to figure out what is causing your program to freeze? What file format are you using (.tif, .czi, .ome.tiff, etc...)? Is the "processed" folder created, and is there anything in it? Which version of valis are you using? Do the examples work for you? Are you using a dedicated virtual environment? If not, did a particular package update result in valis not working anymore? Finally, would it be possible to share some images, so that I could try to replicate this?

Regarding your question about running valis on mac instead of ubuntu, it certainly wouldn't hurt to try. While valis does get tested on mac, linux, and windows, it could be that those tests are not catching the issue you are having. Another option could be to try using the Docker containerhttps://hub.docker.com/r/cdgatenbee/valis-wsi, which has the additional benefit that it shouldn't be affected by any system or package updates you make.

Best, -Chandler

— Reply to this email directly, view it on GitHubhttps://github.com/MathOnco/valis/issues/143#issuecomment-2243358467, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARBV4F7HELAVR6EKWLHTKXTZNUXHJAVCNFSM6AAAAABLILFZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGM2TQNBWG4. You are receiving this because you were mentioned.Message ID: @.***>

dr-sayyadhury commented 1 month ago

Dear Chandler,

Spent the whole day and night de-bugging the isssues and I also went through several of your past issues.

Finally got valis to work. These were several of my issues.

  1. When my VM and remote desktop crashed a few weeks ago, the file systme and conda envs got corrupted. So I had to re-install everything again. What I did not realize is that installing a system level libvips and a pip install pyvips would actually show conflict. So I reviewed your past issues and found someone had a similar error and I ran it.
  2. However, I am still not able to point to why the 'freeze' occured or why the docker failed to run (it kept saying libvips.42 not found). I have not tried it now after re-installing pyvips and libvips using conda so i will let you know.
  3. Finally, my biggest issues is many of my images were saved differently . None of the ome.tiff files from my xenium output can be run on valis - it always throws a slide obj error. So I have to perpetually re-save all my tiffs using pillow. Its quite odd but I don't really want to trouble myself now with it. But I might want to discuss this soon.

I also re-installed maven and checked all my filepaths. Just a small comment - it wasn't very clear on your installation page that we should install pyvips using conda which will cover libvips installation. Or maybe at leastw for me that wasn't obvious. It would really help if that was made more prominent. I think all my various issues stem from incompatbility between my system wide installations and the conda packages and the nature of my image tiffs files.

Sorry for all the trouble. And Thank you. The fact that you respond to most of your issues actually helps us alot.

Regards, Shamini A

cdgatenbee commented 1 month ago

Hi @dr-sayyadhury,

Glad you were able to get this all figured out, but yikes, sorry it was such a nightmare! Regarding using conda, I'd actually recommend using a non-conda environment, if possible. The reason being that valis isn't on conda or conda-forge, so it would have to be "pip installed" in a conda environment, and I think it's usually considered best practice to not mix conda and pip installs inside a conda environment. Part of the reason valis isn't on conda is because, from what I understand, libvips on conda-forge isn't maintained by the authors of libvips, and I'd like the user to have access to the most recent version of libvips as is possible (sometimes versions on conda-forge lag behind the "official" distributions). This may become a non-issue though, because I believe the authors of pyvips/libvips are trying to have libvips be installed along with pyvips when using pip. If that happens, I may take another look at making valis available through conda/conda-forge. While it sounds like everything is working now, all of this might explain the incompatibility issues that were happening, and if they appear again it might be worth trying a non-conda install.

Also, thank you for letting me know about the issues with the Docker container. I do test the container before pushing it to Dockerhub, but maybe I'll have to come up with some test to run the container in an environment where a system level libvips isn't available?

Finally, if you can share an example xenium image, I can see if I can create a compatible SlideReader object so that you won't have to convert the images into tiffs every time.

Best, -Chandler