FAIR-Unipd / dsc-mri-toolbox

Dynamic Susceptibility Contrast MRI toolbox - AIF selection, deconvolution and leakage correction
MIT License
13 stars 7 forks source link

Save maps #4

Open NicoloPecco opened 2 years ago

NicoloPecco commented 2 years ago

Hi Marco,

I was wondering if it is possible to save all of the maps (CBV, CBF etc.) without loosing the nifti header information of the input file (dsc.nii). This step allows to visualize the maps in the same space of the input.

Thank you in advance,

Nicolo

marcocastellaro commented 2 years ago

Dear Nicolo,

I have added here [https://github.com/marcocastellaro/dsc-mri-toolbox/commit/9e1e8cc7349d00ed269072d1fc85cbdb9f754339]

some code in the demo that does the save of the cbv map. just change the map you want to save and enjoy.

Let me know if everything is ok.

nyoman1994 commented 1 year ago

Hi Marco, Sorry I could not get saving the map for the CBF and MTT to work.. Are there other steps I miss?

Thank you, Nyoman

nifti_template = DSC_info; nifti_template.Datatype='double'; nifti_template.BitsPerPixel=64; nifti_template.ImageSize=size(cbf); niftiwrite(cbf,fullfile('demo-data','cbf.nii'),nifti_template) Error using niftiwrite>parseInputs (line 151) The input volume must be specified as a numeric matrix.

Error in niftiwrite (line 89) [V, path, filename, params] = parseInputs(V, filename, varargin{:});

Marijn311 commented 1 week ago

This is the code I used to save all output maps

% ------ Save all 3D spatial results in NIFTI format --------------------- nifti_template = DSC_info; nifti_template.Datatype='double'; nifti_template.BitsPerPixel=64; nifti_template.ImageSize=size(cbv); nifti_template.PixelDimensions=nifti_template.PixelDimensions(1:3); % remove time dimension

niftiwrite(cbv,fullfile(DSC_folder_path, 'CBV.nii'),nifti_template) niftiwrite(cbv_lc,fullfile(DSC_folder_path, 'CBV_lc.nii'),nifti_template) niftiwrite(ttp,fullfile(DSC_folder_path, 'TTP.nii'),nifti_template) niftiwrite(mask,fullfile(DSC_folder_path, 'mask.nii'),nifti_template) niftiwrite(s0,fullfile(DSC_folder_path, 'S0.nii'),nifti_template) niftiwrite(cbf.svd.map,fullfile(DSC_folder_path, 'CBF.nii'),nifti_template) niftiwrite(mtt.svd,fullfile(DSC_folder_path, 'MTT.nii'),nifti_template)

nyoman1994 commented 1 week ago

Hi Marijn, Thanks very much for this.

Actually I have another question regarding the results… Is there a documentation for the results Units (CBV, CBF, MTT)?

Regards, Nyoman

On 12 Nov 2024, at 23:28, Marijn Borghouts @.***> wrote:

This is the code I used to save all output maps

% ------ Save all 3D spatial results in NIFTI format --------------------- nifti_template = DSC_info; nifti_template.Datatype='double'; nifti_template.BitsPerPixel=64; nifti_template.ImageSize=size(cbv); nifti_template.PixelDimensions=nifti_template.PixelDimensions(1:3); % remove time dimension

niftiwrite(cbv,fullfile(DSC_folder_path, 'CBV.nii'),nifti_template) niftiwrite(cbv_lc,fullfile(DSC_folder_path, 'CBV_lc.nii'),nifti_template) niftiwrite(ttp,fullfile(DSC_folder_path, 'TTP.nii'),nifti_template) niftiwrite(mask,fullfile(DSC_folder_path, 'mask.nii'),nifti_template) niftiwrite(s0,fullfile(DSC_folder_path, 'S0.nii'),nifti_template) niftiwrite(cbf.svd.map,fullfile(DSC_folder_path, 'CBF.nii'),nifti_template) niftiwrite(mtt.svd,fullfile(DSC_folder_path, 'MTT.nii'),nifti_template)

— Reply to this email directly, view it on GitHubhttps://github.com/FAIR-Unipd/dsc-mri-toolbox/issues/4#issuecomment-2470530322, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG3EY2P47LI5B25DYJYZMPD2AH665AVCNFSM6AAAAABRUCC7N2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZQGUZTAMZSGI. You are receiving this because you commented.Message ID: @.***>