Giter VIP home page Giter VIP logo

vesselvio's Introduction

Hello 🤖 My name is Jacob! I'm a bioinformatics scientist working in drug discovery at BMS.

I'm passionate about bioinformatics, open-source software development, digital image processing, and ML/DL.

Projects

  • Creating ML/DL/stats educational content @learning-repo and publishing on my personal site (link).
  • @VesselVio, an open-source application for vasculature dataset analysis and visualization

Media and Writing


vesselvio's People

Contributors

dependabot[bot] avatar jacobbumgarner avatar richardscottoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vesselvio's Issues

Could not find the Qt platform plugin "xcb"

Thanks for this great software. Since my Windows machine struggles a bit with visualization, I would like to use it on my much better equipped Linux server. VVTerminal.py also runs there, but unfortunately VesselVio.py does not, although it is the graphics that matter to me. There I get the following error message:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/home/saskra/anaconda3/envs/vesselvio/lib/python3.9/site-packages/cv2/qt/plugins"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Any tips what I could do there? (If I install opencv-python-headless instead of opencv-python, the only change in the error message is that the path is then empty).

[Bug]: Problems loading big graphs

What happened?

Hi Jacob.

I was trying the new version of VesselVio and found that if I analyze several files in batch, everything goes right, and all the files are processed; however, when I try to visualize, the program stops at 70% in the creating mesh step. So it is not possible to visualize them. However, if I visualize them one by one, there is no issue, and the mesh is generated.

Also, one general question is if the skeleton and vessel radii are analyzed with the visualize option, is there a way to export the graph and the features table?.

Again, thanks in advance for your help.

Operating System

Windows

App Build

Downloaded App

Pseudocode or Screenshots

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: No such file or no access: 'VOLUME_FILE.nii'

What happened?

File "e:\VesselVio-main\VVTerminal.py", line 158, in process_volume
volume, image_shape = ImProc.load_volume(volume_file, verbose=verbose)
TypeError: cannot unpack non-iterable NoneType object
vtkDebugLeaks has found no leaks.

When I ran the project, I found this problem, and this data was not available. Also, when I used the software to visualize the voxels, I found that the original blood vessels had already been smoothed and processed at the time of input. But the corresponding module is not found in the project. Where is it?

Operating System

Windows

App Build

Manual app build (pyenv, conda, etc)

Pseudocode or Screenshots

 Insert code here 

Or drag your screenshot here!

Relevant log output

No response

[Bug]: VesselVio Analyze crashed when analyzing my .nii data

What happened?

Hi,

I load my vessel label data as .nii and then i click Analyze tab, the GUI crashed ad File Status (Analyzing features steps). Please help me with this issue.

Many thanks,

Operating System

Windows

App Build

Downloaded App

Pseudocode or Screenshots

 Insert code here 

Or drag your screenshot here!

Relevant log output

No response

[Bug]: fdopen() failed unexpectedly

What happened?

"VesselVio.py" reproducibly crashes on our Windows 10 workstation after 170 files (about 1 hour runtime) with the following error message:

(VesselVio) C:\Users\Vessels-Project\VesselVio>python VesselVio.py
Traceback (most recent call last):
  File "C:\Users\Vessels-Project\VesselVio\library\qt_threading.py", line 263, in run
    GIO.save_cache(filename, gen_options.results_folder)
  File "C:\Users\Vessels-Project\VesselVio\library\graph_io.py", line 303, in save_cache
    g.write(file)
  File "C:\Users\Vessels-Project\anaconda3\envs\VesselVio\lib\site-packages\igraph\__init__.py", line 2988, in write
    return writer(f, *args, **kwds)
RuntimeError: fdopen() failed unexpectedly

This is done both with the downloaded .exe and with the current source code in a separate conda environment. The environment is composed as follows:
environment_windows.txt

Operating System

Windows

App Build

Downloaded App

Pseudocode or Screenshots

 Insert code here 

Or drag your screenshot here!

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Export results from visualization

Describe the feature you would like to be added.

It will be nice to have the option to export the results (graph and features table) when volumes are analyzed in the visualization tab.

Pseudocode or Screenshots

 Insert code here 

Or drag your screenshot here!

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Export Coordinates of Branching / Endpoints

Describe the feature you would like to be added.

I would love to be able to create a CSV with the spatial coordinates of each branching point and one with endpoints as well. This will aid in my analysis of local density of branching points.

Pseudocode or Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Add loading warning when RGB images are loaded.

Describe the feature you would like to be added.

This was an unexpected problem related to an image that a user was trying to load. The image appeared as an 8-bit grayscale and only had two unique values, but was producing curiously different results upon analysis.

After a quick inspection, it was found that the image was actually in an RGB format, yet was still being analyzed. A warning should be added if any images are loaded that are not in grayscale.

Pseudocode or Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Throw a warning if the user loads non-binary images.

Describe the feature you would like to be added.

Because it might be confusing for some what 'segmented' vs. 'binary' images are, a check should be implemented to determine whether the user is loading a non-binary image.

Pseudocode or Screenshots

def binary_check(volume: np.ndarray) -> bool:
    """Return a bool indicating if the loaded volume is binary or not.

    Takes a slice from the volume and checks to confirm that only two unique
    values are present.

    Parameters:
    volume : np.ndarray

    Returns:
    bool
        True if the spot check of the volume only return two unique values,
        False if more than two unique values were identified.
    """
    middle = int(volume.shape[0] / 2)
    unique = np.unique(volume[middle])

    return unique.shape[0] < 3


def segmentation_check(volume: np.ndarray) -> bool:
    """Return a bool indicating if volume has vessels after the segmentation.

    Some regions of interest may be present in the annotation, but there may
    be no corresponding vasculature in the datasets. This function checks to see
    if vessels are present.

    Parameters:
    volume : np.ndarray

    Returns:
    bool
        True if vessels are present, False if not.
    """
    if volume is None:
        return False
    elif not np.any(volume):
        return False
    return True

Screen Shot 2022-05-30 at 11 12 07 AM

Screen Shot 2022-05-30 at 11 11 55 AM

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Add 2D masking compatibility

Describe the feature you would like to be added.

Current VesselVio only allows users to load masks/annotations for 3D images. This functionality should be implemented for 2D images.

Additionally, the need for NiFTI files for annotations should be eliminated to allow for other types of images.

Pseudocode or Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feature Request]: Option to export the skeleton as an image

Describe the feature you would like to be added.

As the title says, it would be handy for me to be able to export the skeleton as an image so I could visually compare it to the segmentation and results of other skeletonization algorithms. Alternatively, I would appreciate tips on if and how I can convert the GraphML file back to a skeleton and save it as an image.

Code of Conduct

  • I agree to follow this project's Code of Conduct

PS: Did you actually change anything besides the speed on the Lee94 skeleton algorithm? Despite the same segmentation and skeletonization (Lee94 using scikit), I got different results with other software. Or is that due to post-processing?

Consider restructuring project into subpackages with subdirectories

Idea is that for each group of related code create a subpackage namespace containing following within the library directory. Try to group related functionality into the same subpackage namespace along with correlating test files. Each directory should contain:

  • README with a description of package contents (github will render these from the directory view just as it would with the repo's main page)
  • specifically named files containing code (convolve.py) (try to avoid generic names like utils.py)
  • corresponding test file (convolve_test.py)
  • directory containing any package specific test data (more general data can just be stored in a directory called data in the root directory)

I'm not sure if this will play nice with how python handles namespaces or you could run into some cyclic dependency problems. This is something you may want to wait to do until after getting more code covered.

New release possible?

Describe the feature you would like to be added.

We would like to include VesselVio inside our Neurodesk.org project. For this we need to run VesselVio in Linux. The latest code version contains a Linux fix that is required, but it's currently not available as a tagged release version.

Is there any chance you can release a new version based on the current main branch?

Thank you
Steffen

Pseudocode or Screenshots

 Insert code here 

Or drag your screenshot here!

Create code coverage badge.

At the top of VesselVio's README there should be a code coverage badge like this: Test Coverage

There are third party services such as coveralls, or code cov, that will generate these badges for you.

I roll my own using github actions and github gists for data storage which gets rendered as a badge via shields.io
Screen Shot 2022-05-16 at 5 01 39 PM

These goofy little badges do a lot to assure other developers that they can trust your code to work as anticipated and help attract more users and contributors.

Questions regarding linked data sets

In your segmentation tips https://github.com/JacobBumgarner/VesselVio#segmentation-tips you link to Vessap, there are among other things also pre-segmented brains for download. Unfortunately, these cause Vesselvio to crash when I try to analyze them. First other programs on the computer no longer work and then the VesselVio window simply disappears. Have you ever tested this as well, and do you think it's more likely due to too weak hardware, or does your software have a general limitation up to a certain file size?
Also, I'd be interested to know if there wouldn't be a way to load the already skeletonized brains offered there as well directly into VesselVio.

Furthermore, you also link to ClearMap/TubeMap in this section, there is even a ready graph available for download: https://osf.io/dtwfg/?view_only=4427a838cbd0468c9fbad9cab465d866 Although VesselVio offers the import of graphs, this one seems to be in the wrong file format. Is there a way to get it in there anyway?

Create test backed tutorial

Go has this really great built-in language feature called an example test

Basic idea is that you write your tutorials as tests that get rendered to your doc site on release. These help increase code coverage but more importantly will never let you release builds with out of date docs. Your CI/CD process will instead yell at you to fix it before you can release it.

I personally find tracking what needs to be updated in my docs impossible without this feature. Someone mentioned to me that there's a third-party thing in Python that does this and if there is such a thing I'd highly recommend it.

SimpleITK ReadImage can't load images with inverted LUTs

This issue was brought to my attention by a user, where images with inverted LUTs (white background, black foreground) are not loaded correctly into the program.

This issue was easily narrowed down to the SimpleITK ReadImage and GetArrayFromImage. Frankly, I'm going to make the decision to replace this with skimage.io.imread(), which seems to load volumes primarily using imageio. Alternatively, I could load the images using cv2.imread().

I'll make a decision on this in the next few days.

White background Black Background

Bounding box doesn't scale correctly when analyzing anisotropic datasets

Describe the bug
As referenced in #14. I've asked for support on this from the devs over at PyVista. If anisotropic show_bounds() scaling isn't a feature that's currently implemented, I'll see if I can figure out how to implement it.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10

Implement unit testing and docstring updates.

When developing VesselVio, I documented all of the classes and functions with comments. Ideally, I would've used docstrings, but at the time, I wasn't in the know!

Now, to improve the code, I want to convert the comments into docstrings to all of the classes and functions. In addition to this, I want to cover these functions with unit tests to ensure the longevity of the code. This documentation and unit testing will be useful for future Sphinx documentation builds, as suggested in #34.

Docstring Updates and Unit Test Implementations Checklist:
The progress of this task can be tracked in the maint/unit_docstring_update branch!
GUI:

  • analysis_options_widget.py
  • analysis_page.py (in progress)
    • Organization and Docstring Update
    • Unit Testing
  • annotation_page.py
  • graph_options_widget.py
  • left_menu.py
  • movie_widgets.py
  • qt_objects.py
  • stylesheets.py
  • update_alert.py
  • visualization_page.py

Backend:

  • annotation_processing.py
  • feature_extraction.py
  • graph_io.py
  • graph_processing.py
  • helpers.py
  • image_processing.py
  • input_classes.py
  • lee94.py
  • movie_processing.py
  • pk12.py
  • qt_threading.py
  • radii_corrections.py
  • results_export.py
  • volume_processing.py
  • volume_visualization.py

Shortcut to VesselVio.exe does not work

The shortcut included in the VesselVio folder should point to "Contents\VesselVio.exe", starting in the same directory.
2022-03-25 13_17_44-VesselVio Properties

  1. Instead it points to the #Users Desktop Folder#\Contents\VesselVio.exe"
  2. The shortcut also points to a target Directory on the original authors computer.

[Feature Request]: Update VesselVio result export behavior

Describe the feature you would like to be added.

Rather than appending the results to the same excel sheet on each analysis, the result should be exported to a new and separate excel file.

Additionally, this update should address the bug where a blank line is added between each result.

Pseudocode or Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

File import - Hierarchical Data Format (HDF) Files (.h5)

Hi there,

thanks for this interactive tool! Looking forward to explore all of its potential.

I have stacked pics taken with LSFM saved as a hierarchical data format (HDF) files (.h5) and I'm wondering if VesselVio can be tunned to take such files directly as import. If not, how would you recommend to proceed?

Thanks!

Distorting meshes based on anisotropic resolution

Describe the bug
When I set the anisotropy in the visualization, neither the graph nor the labelling of the axes changes. For example, if I change 1 µm in the z-axis to 10 µm in the settings, this should also appear in the axis label and the vessels should also be ten times as long in this dimension - but they are not. (Fortunately, it seems to be only a visualization problem, at least I get different results in the analysis tab depending on the z-resolution I set.)

To Reproduce
Steps to reproduce the behavior: See screenshots.

Screenshots
screenshot1
screenshot2

Desktop (please complete the following information):

  • OS: Windows 10

Coords for volume filtering aren't stored as integers, causing crash during original volume visualization

Describe the bug
When users load images that aren't pre-binarized, this can lead to the app crashing. Two recent users reported this issue to me.

To Reproduce
Load any multi-channel image or a non-segmented image into the app.

  • Multi-channel images cause crashes on loading
  • Non-binary images (0 and any other single value) cause the app to crash when trying to visualize the original/smoothed volume.

Additional context
To resolve this problem, I will need to halt the analysis/visualization of non-binary images and throw warnings to the user to alert them that their images aren't compatible.

VesselVio crashing on loading a .tif stack

First of all, thanks for this piece of software. Looks amazing.

Describe the bug
After starting the analysis in one 881 MB binary image, VesselVio crash

To Reproduce
Just start the analysis in a tif image

Screenshots
The following error appears in the prompt:
File "C:\Users\Linux\Documents\GitHub\VesselVio\Library\QtThreading.py", line 101, in run volume, image_shape = ImProc.load_volume(volume_file) TypeError: cannot unpack non-iterable NoneType object

Desktop (please complete the following information):

  • OS: Windows 10
  • Environment created in Anaconda. conda list attached

Additional context
We find no issues with smaller datasets
VesselVio_Env.txt

CD for binary build deployment

The install instructions include a link to download executable binaries for both MacOSX and Windows but I can't find these binaries as part of Vessel's latest Github release. Instead there are only links to sourceforge. On each release they should be automatically built and pushed to a github release then deployed to each systems' respective package manager (homebrew, apt-get, choco, etc).

I used to do this when I was shipping a CLI with one of my projects using GoReleaser. It's Go specific but the idea is the same. GoReleaser builds and deploys to almost every modern architecture/OS/package manager under the sun. Maybe there's a python equivalent?

Adopt an explicit style guide and linter

At a glance code is clean but VesselVio should adhere to some style guidelines that remove ambiguity and make it easier for contributors to develop and read. It looks like you already have flake8 and some rules set up which is good. Try setting up an autolinter if possible.

Big one for me personally is that I follow a literate programming style and almost never let myself or contributors merge code containing single letter variables. Makes reading code years later actually possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.