ExploreASL / ExploreASL

ExploreASL: releases can be found in the main branch or within the releases tab. If you want to contribute, please contact us at h.j.mutsaerts@amsterdamumc.nl. Development details can be found under the wiki tab. Code documentation can be found on the documentation website https://exploreasl.github.io/Documentation
https://www.exploreasl.org
Other
45 stars 12 forks source link

xASL_io_ExportVTK #384

Closed MichaelStritt closed 3 years ago

MichaelStritt commented 3 years ago

There's a pretty nice 3D software called Paraview that I used a lot at University. It requires files in VTK format. I saw that there's a Matlab script with MIT License which can convert image data to structure_points in VTK format. I implemented a small wrapper which would work nicely in ExploreASL. What do you think about adding it?

How to test

xASL_io_ExportVTK(x.MyPath,niftiPath);

The script will print the license information and export a export.vtk file to the corresponding directory. There's also a unit test called xASL_ut_UnitTest_function_ExportVTK which shows all the different options.

Exemplary M0 image in ParaView

image

Release note: Method to export image matrices as structured points in VTK format.

MichaelStritt commented 3 years ago
              name                  unit          tests        passed
    _________________________    __________    ____________    ______

    'xASL_tsvRead'               'Function'    [1×2 struct]    true  
    'xASL_tsvWrite'              'Function'    [1×2 struct]    true  
    'xASL_io_Nifti2Im'           'Function'    [1×1 struct]    true  
    'xASL_test_GetLogContent'    'Function'    [1×2 struct]    true  
    'xASL_io_ExportVTK'          'Function'    [1×5 struct]    true  
MichaelStritt commented 3 years ago

Change Requests:

MichaelStritt commented 3 years ago

Simple Test

>> test_mask = '.\ExploreASL\External\SPMmodified\toolbox\cat12\templates_volumes\brainmask.nii';
>> test_image = '.\ExploreASL\External\SPMmodified\toolbox\cat12\templates_volumes\brainmask.nii';
>> xASL_io_ExportVTK('C:\...\ExploreASL',test_image,test_mask,'C:\...\testVTK\export.vtk');
We assume that image and mask have the same orientation...
Export vtk as structured points...