How can I create a 15Gy mask file from RTDose nifti file?

1 Ansicht (letzte 30 Tage)
PandaCadet5
PandaCadet5 am 23 Jan. 2023
Beantwortet: Rishav am 7 Apr. 2023
I am wanting to create a 15Gy mask file for an RTDose nifti file to be able to visualize regions of the volume that recieve a dose >15Gy.
My code currently is as follows, however, it does not quite trace back to what I was hoping for. I attempted creating a logical matrix for values greater than 15, then cast it back to the original single datatype. When I overlay my two files, it appears as though the frame of reference for the new dose file is shifted as if (0,0,0) is not the same for the original dose file. Additionally, I believe the dimensions are shifted as well for the new file.
V = niftiread('MRIfile.nii.gz')
V = double(V >= 15);
mask = cast(V, "single");
niftiwrite(mask,'15GyMask.nii')

Antworten (1)

Rishav
Rishav am 7 Apr. 2023
It looks like you are trying to create a mask file from an RTDose nifti file, to visualize regions of the volume that receive a dose greater than 15Gy.
Your code seems to be on the right track, but you may need to adjust the image orientation and dimensions to ensure that the mask file aligns correctly with the original dose file.
Here is some modified code that may help:
% Read in the original dose file
dose = niftiread('RTDose.nii.gz');
% Create the mask file
mask = single(dose > 15);
% Obtain the metadata of the original dose file
info = niftiinfo('RTDose.nii.gz');
% Adjust the orientation and dimensions of the mask file to match those of the original dose file
mask = niftireorient(mask, info);
mask = niftiresize(mask, size(dose), 'linear');
% Save the mask file with the same metadata as the original dose file
niftiwrite(mask, '15GyMask.nii', info);

Kategorien

Mehr zu Biomedical Imaging finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by