cerr / CERR

Matlab/Octave based platform for Radiological Research.
https://cerr.github.io/CERR/
GNU Lesser General Public License v2.1
191 stars 101 forks source link

Failure importing .nii mask #728

Open amitjc opened 2 years ago

amitjc commented 2 years ago

Dear Experts,

I intend to perform radiomics analysis on HCC.

However, when I attempt importing .nii mask/segmentation as described at https://github.com/cerr/CERR/wiki/Importing-NIfTI-data#importing-nii-masks, following error is encountered:

Error using nifti_read_volume (line 46)
Unsupported datatype

Error in importNiftiSegToPlanC (line 50)
[vol,info] = nifti_read_volume(structFileName);

The commands executed for importing Nifti are as follows:

% Define location of nii file to import and the the location to save the resulting planC.
    niiScanFileName = 'R:\LIVER_CASES_FOR_SEG\CJ31056_T_TRIPHASE_20130129200529_12.nii'; 
    plancSaveName = 'R:\LIVER_CASES_FOR_SEG\cerr_planc.mat';   
    scanName = 'CT';
    planC = nii2cerr(niiScanFileName,scanName);
    % Save planC
    planC = save_planC(planC,[],'passed',plancSaveName);
CERR>>  Using zValues to compute voxel thicknesses.
CERR>>  Saving cerr_planc.mat...
CERR>>  Saved cerr_planc.mat. Ready. (21-May-2022 23:21:41)
>> % Define the location of nii file containing label mask
    niiMaskFileName = 'R:\LIVER_CASES_FOR_SEG\CJ31056DONE\M_seg.nii';  
    % Define the scan index in planC to associate the labels/structures.
    scanNum = 1; 
    planC = importNiftiSegToPlanC(planC,niiSegFileName,scanNum);

Also, the images are flipped horizontally following Nifti scan import.

Please guide.

Thank you.

Best Regards, Amit.

adityaapte commented 2 years ago

Hi,

I see that srow_z is not handled by https://github.com/cerr/CERR/blob/master/CERR_core/Utilities/nii2cerr.m which might the reason for flip in z orientation. Not sure what is causing the unrecognized data type for segmentation file. Will it be possible for you to share the dataset with me?

Thanks, Aditya

On Sat, May 21, 2022, 2:17 PM amitjc @.***> wrote:

Dear Experts,

I intend to perform radiomics analysis on HCC.

However, when I attempt importing .nii mask/segmentation as described at https://github.com/cerr/CERR/wiki/Importing-NIfTI-data#importing-nii-masks, following error is encountered:

Error using nifti_read_volume (line 46) Unsupported datatype

Error in importNiftiSegToPlanC (line 50) [vol,info] = nifti_read_volume(structFileName);

The commands executed for importing Nifti are as follows:

% Define location of nii file to import and the the location to save the resulting planC. niiScanFileName = 'R:\LIVER_CASES_FOR_SEG\CJ31056_T_TRIPHASE_20130129200529_12.nii'; plancSaveName = 'R:\LIVER_CASES_FOR_SEG\cerr_planc.mat'; scanName = 'CT'; planC = nii2cerr(niiScanFileName,scanName); % Save planC planC = save_planC(planC,[],'passed',plancSaveName); CERR>> Using zValues to compute voxel thicknesses. CERR>> Saving cerr_planc.mat... CERR>> Saved cerr_planc.mat. Ready. (21-May-2022 23:21:41)

% Define the location of nii file containing label mask niiMaskFileName = 'R:\LIVER_CASES_FOR_SEG\CJ31056DONE\M_seg.nii'; % Define the scan index in planC to associate the labels/structures. scanNum = 1; planC = importNiftiSegToPlanC(planC,niiSegFileName,scanNum);

Also, the images are flipped horizontally following Nifti scan import.

Please guide.

Thank you.

Best Regards, Amit.

— Reply to this email directly, view it on GitHub https://github.com/cerr/CERR/issues/728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNJBYEJQHB6UCN6RYATBLVLESCLANCNFSM5WSE7TXA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

amitjc commented 2 years ago

Dear @adityaapte ,

Thank you for the prompt response.

Request your collaboration on the private repo (containing data).

Look Forward to further guidance.

Best, Amit.

adityaapte commented 2 years ago

Please let me know your email address and I can share a secure link for data upload. Thanks.

On Sat, May 21, 2022, 11:23 PM amitjc @.***> wrote:

Dear @adityaapte https://github.com/adityaapte ,

Thank you for the prompt response.

Request your collaboration on the private repo (containing data).

Look Forward to further guidance.

Best, Amit.

— Reply to this email directly, view it on GitHub https://github.com/cerr/CERR/issues/728#issuecomment-1133810340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNJB65HVFPRINTSKRB373VLGSCHANCNFSM5WSE7TXA . You are receiving this because you were mentioned.Message ID: @.***>

amitjc commented 2 years ago

Any Updates?

adityaapte commented 2 years ago

I tested the updates pushed to GitHub on a few more datasets with success. Can you please pull the latest and see if they resolve the issue? Thanks.

On Sun, May 29, 2022, 1:37 PM amitjc @.***> wrote:

Any Updates?

— Reply to this email directly, view it on GitHub https://github.com/cerr/CERR/issues/728#issuecomment-1140493396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNJBZ32O5GY5B5BA4EJS3VMOTOVANCNFSM5WSE7TXA . You are receiving this because you were mentioned.Message ID: @.***>

amitjc commented 2 years ago

Dear Dr. Apte,

Thank you for the continued support.

Running the commands for importing .nii mask, leads to following output

% Define the location of nii file containing label mask
    niiMaskFileName = 'R:\LIVER_CASES_FOR_SEG\CJ31056DONE\M_seg.nii';  
    % Define the scan index in planC to associate the labels/structures.
    scanNum = 1; 
    planC = importNiftiSegToPlanC(planC,niiSegFileName,scanNum);
Warning: No rasterSegments exist for structure ROI_1, generating. 
> In getRasterSegments (line 98)
In updateStructureMatrices (line 65)
In maskToCERRStructure (line 127)
In importNiftiSegToPlanC (line 81) 
Creating raster-scan representation of roi_1 contour.
Saving updated data for ROI_1...
Warning: No rasterSegments exist for structure All lesions, generating. 
> In getRasterSegments (line 98)
In updateStructureMatrices (line 65)
In maskToCERRStructure (line 127)
In importNiftiSegToPlanC (line 84) 
Creating raster-scan representation of all lesions contour.
Saving updated data for All lesions...
>> CERR
Working Directory: R:\LIVER_CASES_FOR_SEG\CJ31056DONE\
CERR>>  Loading cerr_planc.mat...
Warning: No dose set found. Displaying scan and structures only 
> In getDoseSet (line 36)
In sliceCallBack (line 582)
In sliceCallBack (line 1766

Unable to call the labeled mask from the gui for radiomics analysis.

Running the radiomics analysis on the entire dataset requires 3 hrs. Please guide to perform analysis on the segmented region.

Best, Amit.

amitjc commented 2 years ago

Dear Sir,

Looking forward to your guidance on the issue.

Thank you.

Best Regards, Amit.

adityaapte commented 2 years ago

Hello Amit,

Can you please describe the issue? Is the segmentation not displaying correctly on the viewer?

Thanks, Aditya

On Tue, Jun 21, 2022, 10:37 PM amitjc @.***> wrote:

Dear Sir,

Looking forward to your guidance on the issue.

Thank you.

Best Regards, Amit.

— Reply to this email directly, view it on GitHub https://github.com/cerr/CERR/issues/728#issuecomment-1162563669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGNJB4MO7L3CW4ZQEGUG3LVQJ36ZANCNFSM5WSE7TXA . You are receiving this because you were mentioned.Message ID: @.***>

amitjc commented 2 years ago

Dear Sir,

The segmentation (imported in .nii format) is not displayed. The CT scan can be viewed, though.

I also need to restrict the radiomics analysis to the segmented volume, rather than entire CT dataset; the latter being quiet resource intensive (at time leading to system failure) and time consuming.

Thank you.

Best Regards, Amit.