Comments (2)
Sorry,I already know how to save in NII format, but I'd still like to know how to see the raw segments in the MATLAB workspace
from pulmonarytoolkit.
Here are two ways:
-
Using the GUI, you can "Export Segmentation" and choose "Format: Matlab". This should save the segmentation matrix as a Matlab .mat file, which you can load into the workspace. The segmentation matrix is of datatype uint8, where 0 means no segmented region, and other values mean part of a segmentation, where the values used depend on the type of segmentation. For example, for lung segmentations, 1 is Right and 2 is Left.
-
You can write a script which uses the API (see Tutorial 3 for an introduction) and fetch the result of the corresponding segmentation plugin using
dataset.GetResult()
. The result will usualy be aPTKImage
object, whose propertyRawImage
is the Matlab matrix containing the segmentation values (same as above). NB be aware the segmentation image you get will be cropped to the lung region of interest by default - if you don't want this and want a full size image, then you would do this by adding an additional "context" argument set toPTKOriginalImage
to theGetResult()
call. For exampledataset.GetResult('PTKLeftAndRightLungs', 'PTKOriginalImage');
Here is a rough example script for fetching lung and lobe segmentations using the API (Note I have not tested this!)
PTKAddPaths;
ptk_main = PTKMain();
uid = `PUT_THE_UID_FOR_YOUR_DATASET_HERE`;
dataset = ptk_main.CreateDatasetFromUid(uid);
lung_segmentation = dataset.GetResult('PTKLeftAndRightLungs');
% Now lung_segmentation.RawImage contains the lung segmentation matrix
lobe_segmentation = dataset.GetResult('PTKLobes');
% Now lobe_segmentation.RawImage contains the lobe segmentation matrix
from pulmonarytoolkit.
Related Issues (20)
- plumonary toolkit failure HOT 3
- PTK viewer zoom HOT 6
- Change coordinates HOT 1
- Deleting multiple patients HOT 3
- Saving Output as different name? HOT 1
- Hessian based fissure filter
- Can't Load Nii files in pulmonary toolkit HOT 4
- Cannot seperate lung lobes while there is a thin or irregular fissure ? HOT 1
- Running in non-interactive mode HOT 1
- How to export Parameter LungAnalysis in Matlab's Workspace? HOT 2
- Freehand editing of airways HOT 1
- Broken links for documentation HOT 1
- User stories related to PTK
- Error using "lung" tool HOT 1
- asking passward HOT 1
- asking lung images HOT 2
- erroring when clicked the coronal analysis,sagittial analysis ,axial analysis button HOT 2
- can not import .nii file HOT 1
- Java Heap space HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulmonarytoolkit.