kschan0214 / QSM_Consensus_Paper_Example_Code

This repository contains all the example QSM recon codes for QSM consensus paper data
4 stars 2 forks source link

question about line 108 in Preparation_04_prepare_for_sepia.m #1

Closed MCube78 closed 1 week ago

MCube78 commented 10 months ago

shouldn't the first parameter in save_nii_img_only, in line 108, be "fullfile(input_dir,curr_echo_phase_filename)" and NOT fullfile(input_dir,curr_echo_mag_filename)? Isn't this line, as is, taking the magnitude image and renaming it to phase? I ask because, inctead I would have expected it to parallel line #107 but for the phase image.

https://github.com/kschan0214/QSM_Consensus_Paper_Example_Code/blob/0db21d544a67bbcc7c841ee07aa79d029e798f3f/From_DICOM_zip_file_to_SEPIA_ready/Preparation_04_prepare_for_sepia.m#L108

My apologies if I am misunderstanding the code!

cheers

Martin

kschan0214 commented 10 months ago

Hi Martin,

The save_nii_img_only.m is a wrapper function of save_untouched_nii.m which takes a minimum of 3 input arguments: save_nii_img_only(headerfilename,savefilename,images)

The first input corresponds to the NIFTI filename from which the header info (mainly the geometric information) will be copied to the new NIFTI file. The second input corresponds to the filename to be exported, and the third input is the image data to be saved in the new NIFTI file.

In this instance, it means that the phase data will be exported to a new NIFTI file using the geometry stored in the magnitude NIFTI data. Since save_nii_img_only.m resets the scale intercept to 0 and the scale slope to 1 anyway, it actually doesn't matter if it copies the geometry from the magnitude data or the phase data (because they are the same).

Just let me know if there is anything unclear :)

Best,

Kwok