Giter Club home page Giter Club logo

pulmonarytoolkit's Introduction

The Pulmonary Toolkit is a software suite for the analysis of 3D medical lung images for academic research use.

It consists of:

  • a GUI application for visualising and analysing clinical lung images (CT & MRI);
  • a rapid prototyping framework for running existing algorithms and developing new algorithms;
  • an API which allows you to use the framework from within your own code, independent of the GUI application;
  • a library of lung analysis algorithms which can be used independently.

This is experimental research software and is primarily intended to support our own work. However, we are happy for you to make use of the software, and we have therefore made the source code available for free under the open-source licence (GNU-GPL3).

This software requires:

  • Matlab (version R2011a or later)
  • A C++ compiler is needed for a number of the segmentation routines
  • Matlab Image Processing Toolbox
  • Matlab Statistics and Machine Learning toolbox is currently needed to support some of the analytics (specifically prctile)

This software is intended for research purposes only. It is not intended for clinical use.

Online manuals

PDF tutorials can be found in the Downloads folder after checking out the project, or you can download them directly here:

Installing the Pulmonary Toolkit

Tutorial 1 - Loading and visualising data

Tutorial 2 - Exporting data

Tutorial 3 - Programming with the Pulmonary Toolkit

Tutorial 4 - Lobar analysis of CT data

Please note that the tutorials only cover a few of the features of the Toolkit.

What can I do with the Pulmonary Toolkit?

There are many ways of using the Toolkit, for example:

  • Use the GUI to load lung images from Dicom or mhd/raw files, perform automated analysis such as lobe segmentation or emphysema detection, and then save the results out;
  • Write your own plugins to perform image analysis tasks, such as regional detection of lung disease;
  • Write a Matlab script to perform automated analysis on hundreds of datasets using the Toolkit's API, for example gathering airway measurements;
  • Using the PTKViewer tool to quickly view 3D datasets from the Matlab command window;
  • Build your own medical application, by adding the Toolkit's image viewing panel (PTKViewerPanel) to your application;
  • Use the Toolkit's suite of library functions to help in loading/saving, image processing (e.g. 3D watershed transforms) and image analysis

Requirements

To run the current alpha version you will need the following:

  • Matlab version R2010b or later
  • The Matlab Image Processing Toolbox
  • A C++ compiler
  • (recommended) a Git client

Releases

You can download and run the software but please be aware the Toolkit is currently in alpha. There is currently no stable release. We recommend you check out the latest version using Git and pull regularly from the master branch to obtain new features and bug fixes.

See the GitHub website for more information on how to obtain the source code. While you can download a zip file, I recommend you use Git as it is easier to obtain updates. Git clients are available for all operating systems

Please pull changes regularly from the GitHub repository to receive new features and fixes.

Support

Support is provided via the Tutorials and the wiki.

If you are experiencing problems, please make sure you have the required version of Matlab and the Imaging Processing Toolbox. Please also ensure you have a suitable C++ compiler installed and set up. The Toolkit will not work correctly without these.

Please update your git checkout to obtain the latest bug fixes.

The toolkit works primarily with medical Dicom images, but there is also limited support for mhd/mha files

License

You may download and use the Toolkit subject to the conditions of the GNU GPL v3 license. Note that under this license you can use the Toolkit in your own software, but if you do, and if you distribute your software to anyone else, then you must also make your software source code freely available. See the GNU GPL v3 license for details.

Note: Some parts of the software in the External folder are covered by different licences - see the licence files in the External folder for details.

pulmonarytoolkit's People

Contributors

kant avatar kbur030 avatar sevketasurgan avatar tomdoel 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

Watchers

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

pulmonarytoolkit's Issues

starting toolkit using API problem

when i write ' file_infos = PTKDicomUtilities.GetListOfDicomFiles(source_path);', it says 'Undefined variable "PTKDicomUtilities" or class PTKDicomUtilities.GetListOfDicomFiles". i defined file path in source_path. please help

Failed to import files from nifti format

I have problems in importing nifti images into PTK. It showed error: "Failed to load dataset due to error: Cell contents reference from a non-cell array object".

Freehand editing of airways

I would like to edit the airway segments and recalculate radius and center-line for the edited airways. Current options support adding/erasing predetermined patches based on intensity threshold. Is it possible to add regions to airway segments using a freehand polygon drawing tool? As an alternative, is it possible to calculate radius and center-line for manual segmentation?

PTK viewer zoom

I used PTK to load up a scan recently. Its compressed Dicom images of ARDS patient.
It loads fine on ITK-snap and 3D slicer.
But PTK zooms it when imported and seems to crop out the image. Is there any setting i should change. Thanks.

plumonary toolkit failure

I am getting the following error while segmenting lung field or lobel using the toolkit
The plugin PTKlobes failed with the following error:
Subscript indices must either be real positive integers or logicals.

Window and Level values always rounded to integer

The UI will round the window and level values entered in the text boxes to the nearest integer.
For most Dicom images this is the preferred behaviour; however when dealing with images of floating point values it might be desirable to set a non-integrer value.

May require changes to:

  • MimPluginLabelEditBox
  • MimPluginLabelSlider
  • MimViewerPanelToolbar
  • MimViewerPanelCallback:ModifyWindowLevelLimits
    and consideration of how the window/level values affect other parts of the codebase

Running errors

PTKAddPaths;
ptk_main = PTKMain;
Error: File: PTKMain.m Line: 62 Column: 5
Function definitions in a script must appear at the end of the file.
Move all statements after the "PTKMain" function definition to before the first local function
definition.

Undefined variable "obj" or class "obj.Reporting.Error"

The plugin PTKLobes failed with the following error: Undefined function or variable 'PTKLobeMapForMRI'.
The plugin PTKLobes failed with the following error: Undefined function or variable 'PTKLobeMapForMRI'.
The plugin PTKSaveLobarAnalysisResults failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKSaveLungAnalysisResults failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKSaveADCAnalysisResults failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKSaveCoronalAnalysisResults failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKSaveLungAnalysisResults failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKAirwayDistanceTransform failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKCarina failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".
The plugin PTKAirwayDistanceTransform failed with the following error: Undefined variable "obj" or class "obj.Reporting.Error".

How can I solve this issue? In every class I have this same problem Undefined variable "obj" or class "obj.Reporting.Error"

Cannot seperate lung lobes while there is a thin or irregular fissure ?

First of all, thank you for your amazing work, Good Job !
As I tested for a long time, this program is not able to seperate some lung lobes if fissureness is thin or irregular , 'correctly' ; there are colour overflows in segment > lobes section.
How can I improve this, in which '.m or .c' file(s) part , I need to upgrade ?

Problems with full-body CT

Some full-body CT datasets may not process correctly due to a problem with finding the region of interest (ROI) for full-body CT datasets.

As a workaround you can export the lung region using a suitable viewer such as OsiriX. For best analysis results make sure the exported region includes the whole of the lung.

win-gui missing

It seems the 'win-gui' part is missing from the prebuilt release 1.0.0?

Changing coordinate system

How could I change the coordinate system from PTK coordinates to DICOM coordinates (based on your tutorial 2? Could I change it from the GUI?

PTKDensityAverage fails with negative pixel data

Can occur if the underlying pixel data values are negative (or more generally have an intercept of -1024). This is due to PTKLungInteriorNonParenchymaPoints not converting the minimum value correctly.

Apparent "hang" on launch: stuck waiting for input if GitHub has not been added to authorized_hosts

When launching PTK for the first time, if the GitHub RSA key fingerprint has not been added to the authorized_hosts then the update check may wait silently for input. The (unreported) message is "The authenticity of host [...] can't be established. RSA key fingerprint is [...]. Are you sure you want to continue connecting (yes/no)? and yes or no should be entered to proceed.
The problem is caused because git remote update cannot be run in a way that avoids this message, Matlab's system command swallows the output by default.

How to save segmentation results in NIFTI format

Hello,I don‘t know How to save segmentation results in NIFTI format?
I use the “export segmentation ” at GUI ,then I get an RGB image in DICOM format.
I was wondering where I should find the original segmentation results in MATLAB.

undefined function 'ordf'

Sorry for another question. After manage to load CT images, click any module, it always failed and gave some the following information:

The plugin PTKSpongeModel failed with the following error: Undefined function 'ordf' for input arguments of type 'double'

Could you help me to resolve the problem? I am using matlab 2015a on Window 7.

Thanks

erroring when clicked the coronal analysis,sagittial analysis ,axial analysis button

First of all, thank you for providing the software. I made the following error when I clicked the coronal analysis button while running: The plugin PTKSaveCoronalAnalysisResults failed with the following error: The unidentified field name is called "SetPreferredOrientation".; Exception message: The unidentified field name is "SetPreferredOrientation".: PTKDivideLungsIntoCoronalBins.RunPlugin(can you help me,thanks) @tomdoel.

Error using "lung" tool

Dear Developers,
When I use the "lung" tool, I encounter the following error,
Error in PTKWatershedFromStartingPoints(PTK1.0.1) : PTKWatershedMeyerFromStartingPoints has not been compiled. You must compile using mex PTKWatershedFromStartingPoints. Alternatively, use the slower Matlab equivalent function mex PTKWatershedFromStartingPointsMatlab().
Stack:PTKWatershedFromStartingPoints(12); SeparateLungs(186); PTKSeparateAndLabelLungs(30); PTKGetLeftAndRightLungs(16); PTKLeftAndRightLungsInitialiser.RunPlugin(55); MimContextHierarchy.GetResultRecursive(192); MimDatasetResults.GetResult(126); MimDatasetCallback.GetResult(87); PTKLeftAndRightLungs.RunPlugin(50); MimContextHierarchy.GetResultRecursive(192); MimDatasetResults.GetResult(126); MimDataset.GetResultWithCacheInfo(148); MimGuiDataset.RunPluginTryCatchBlock(683); MimGuiDataset.RunPlugin(449); MimGuiBase.RunPluginCallback(604); PTKSegmentLungs.RunGuiPlugin(33); MimGuiBase.RunGuiPluginCallback(581); MimGuiPluginWrapper.RunPlugin(21); @(varargin)tool_wrapper.RunPlugin(varargin{:})(255); MimPluginLabelButton.ButtonClickedCallback(48); @(varargin)obj.ButtonClickedCallback(varargin{:})(40); GemButton.ButtonClickedCallback(134); @(varargin)obj.ButtonClickedCallback(varargin{:})(109); \n

I look forward to your help, thank you very much!
Guo Weiqi

can't do automatic lung segmention

hello tomdoel,

your code looks nice and the lung segmentations using the GUI works well.
But if I try to do some automatic segmentation, using your tutorial "TK - Tutorial 3.pdf" something is going wrong....

If I try:

file_infos = PTKDiskUtilities.GetListOfDicomFiles(source_path);

this error occures:

The class PTKDiskUtilities has no Constant property or Static
method named 'GetListOfDicomFiles'.

The source_path includes mhd and raw files.
do you have any advice? would be great!

Thanks

Deleting multiple patients

Hello,
thanks for developing Pulmonary Toolkit.
Maybe, I just did something wrong while importing the data, but every single slice from the measurement imported as an individual patient. So the result is about 200 imported patients in patient browser. Is there any possibility how to delete multiple patients in one operation? Or an option to reset all settings of PTK?
Thank you in advance.

Java Heap space

Hi!
Thanks for your work. When I try to load a volume in the GUI, i get the following Java error:
Unable to extract region of interest from this dataset. Error: Java exception occurred:

java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Unknown Source)
	at java.io.ByteArrayOutputStream.grow(Unknown Source)
	at java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source)
	at java.io.ByteArrayOutputStream.write(Unknown Source)
	at com.mathworks.mlwidgets.io.InterruptibleStreamCopier.copyStream(InterruptibleStreamCopier.java:74)
	at com.mathworks.mlwidgets.io.InterruptibleStreamCopier.copyStream(InterruptibleStreamCopier.java:51)
Failed to load dataset due to error: Java exception occurred: 
java.lang.OutOfMemoryError: Java heap space
Failed to load dataset due to error: Java exception occurred: 
java.lang.OutOfMemoryError: Java heap space

Do you have any idea why it happens?
Thank you very much.

An error when use "Segment the segments". Thanks!

Hi, tomdeol.
Thanks for your great work!
When I use the "Segment the segments" in toolkit. Two errors when I deal with different dicom sequences.

  1. The plugin PTKPulmonarySegments failed with the following error: Error in function SeparateSmallestBranchByRadius: Could not subdivide the tree into exactly the desired number of branches.
  2. The plugin PTKPulmonarySegments failed with the following error: Attempt to access sample_image(16,18,29);As size(sample_image)=[2,2,2], is out of range。
    Thanks
    Gu Yu.

Save Data

Hi,
When I try to use the function, PTKSaveAs, to save the data, it always shows that Undefined function or variable 'PTKSaveAs'. Even when I try to do doc PTKSaveAs, it always shows that No results for PTKSaveAs. Is there any way to save the data into mhd file or nii file without using GUI.

some questions about the code

Hello, Tom
Thanks so much for your nice code, it's very clear. I spent a week analyzing it,but sometimes I didn't know why u dealt it in that way(I can understand your code, but I don't know why..).

Could u give me a list of paper that you refer to ?
I'll keep focusing on your work.

Change coordinates

Hello, I need to change the coordinate system from PTK coordinates to DICOM coordinates (based on tutorial 2), but i can't do it. Is anyone able to help me? Thanks thanks,
Monica

How to export Parameter LungAnalysis in Matlab's Workspace?

Hello Mr. Tom Doel
I am Amir Zamanpour, I am medical imaging student at Mashhad university of medical science. first of all, thanks for your useful app(Pulmonary Toolkit), I want to use it for processing lung CT images, I succeed to use GUI pulmonary toolkit in MATLAB and save CSV file by Lung Analysis, but I need to use script code about that, I read "PTK - Tutorial 3" pdf file and write and run script file for load and auto segment lung right now but I need to extract lung promoters(like CSV file) in workspaces in MATLAB but I do not know which function to use? (can you help me about that).

User stories related to PTK

Hi,
This project seems well advanced!
Would you have stories to share regarding the use of PTK (success in discovery, use-case, ...)?
Thanks :)

can not load dicom file

Thanks for developing this fantastic tool. When I load lung Dicom data, it popped up a message box saying 'No appropriate method, property or field 'GetKey for class PTKPluginResultsInfo'.

could you help me resolve this issue?

In addition, could you put some test data for the user to test?

Running in non-interactive mode

Thanks for the nice toolkit. Is there documentation to get started on using PTK in batch mode? I would like to run airway segmentation on a bunch of CT scans without going through the GUI.

Int16 input argument

Hello.

This software really looks great. However, when we try to run a variety of different functions including segmentation of the lungs, lobes, and segments, I am receiving the following error:

The plugin PTKLeftAndRightLungs failed with the following error: Underfined function ‘PTKWatershedFromStartingPoints’ for input arguments type ‘int16’;

The airway segmentation works fine.

Thanks

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.