cerr / CERR

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

Extracting Radiomics from Different Dose Distribution in the same planC #755

Open EvandroMolinari1998 opened 2 years ago

EvandroMolinari1998 commented 2 years ago

In my planC I have 3 different dose distributions (IMRT, VMAT and 3D) generated by 3 different RTplans. I wish to select from wich dose distribution matlab will extract the radiomics.

adityaapte commented 2 years ago

The dose can be accessed as follows: global planC % or load from file indexS = planC{end}; doseNum = 1; doseS = planC{indexS.dose}(doseNum);

DVH-based features, for example can be extracted as follows:

[doseV,volV] = getDVH(structNum,doseNum,planC);[doseBinsV,volHistV] = doseHist(doseV,volV,binWidth);dvhFeatS.meanDose = calc_meanDose(doseBinsV, volHistV);dvhFeatS.d10 = calc_Dx(doseBinsV, volHistV, 10, 1);dvhFeatS.v30 = calc_Vx(doseBinsV, volHistV, 30, 0);dvhFeatS.MOH55 = calc_MOHx(doseBinsV, volHistV, 55);

Note that dose can also be converted to scan with the following call (use "testing" branch of CERR from GitHub for this). doseNum = 1; scanType = 'Dose summary'; gridType = 'dose'; planC = dose2scan(doseNum,scanType,gridType,planC);

The above code will store dose as a scan entry in planC. IBSI compliant radiomics can be computed as follows: scanNum = length(planC{indexS.scan});

paramS = getRadiomicsParamTemplate(sampleParamFile);

radiomicsFeatS = calcGlobalRadiomicsFeatures...(scanNum, structNum, paramS, planC);

On Thu, Sep 1, 2022 at 2:56 PM EvandroMolinari1998 @.***> wrote:

In my planC I have 3 different dose distributions (IMRT, VMAT and 3D) generated by 3 different RTplans. I wish to select from wich dose distribution matlab will extract the radiomics.

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

EvandroMolinari1998 commented 2 years ago

Thanks a lot! When I use "planC = dose2scan(doseNum,scanType,gridType,planC)" I get: Error using dose2scan Too many output arguments.

In adition, once I fix this issue i wanna know if it's possible to use this planC from dose2scan to other feature classes.

adityaapte commented 2 years ago

Please use the "testing" branch. It has the correct output argument planC. https://github.com/cerr/CERR/blob/testing/CERR_core/Utilities/dose2scan.m

The pseudo-scan in planC can be used to compute radiomics features.

-Aditya

On Fri, Sep 2, 2022 at 9:31 AM EvandroMolinari1998 @.***> wrote:

Thanks a lot! When I use "planC = dose2scan(doseNum,scanType,gridType,planC)" I get: Error using dose2scan Too many output arguments.

In adition, once I fix this issue i wanna know if it's possible to use this planC from dose2scan to other feature classes.

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

EvandroMolinari1998 commented 2 years ago

I tested this 'testing' branch and got this pseudo-scan in planC, nonetheless, when I select the three different dose distributions with the 'doseNum' I compute the same values for the First order statistics features.

In adition, when I try de command 'paramS = getRadiomicsParamTemplate(sampleParamFile)' I get this error: Unrecognized function or variable 'sampleParamFile'.

adityaapte commented 2 years ago

sampleParamFile is a path to the .json file containing calculation settings. For example,

sampleParamFile = fullfile(getCERRPath,'PlanMetrics','heterogenity_metrics','sample_radiomics_extraction_settings.json');

Here is the description of the file. https://github.com/cerr/CERR/wiki/Global-radiomics-feature-calculation-parameters

On Fri, Sep 2, 2022 at 11:45 AM EvandroMolinari1998 < @.***> wrote:

I tested this 'testing' branch and got this pseudo-scan in planC, nonetheless, when I select the three different dose distributions with the 'doseNum' I compute the same values for the First order statistics features.

In adition, when I try de command 'paramS = getRadiomicsParamTemplate(sampleParamFile)' I get this error: Unrecognized function or variable 'sampleParamFile'.

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

EvandroMolinari1998 commented 2 years ago

When I select the three different dose distributions with the 'doseNum' I compute the same values for the First order statistics features. And when I compare the planC before and after 'planC = dose2scan(doseNum,scanType,gridType,planC);' I realize that there is no difference. How can I fix this?

adityaapte commented 2 years ago

Are you selecting different scan number as an input for radiomics calculation? For example, after dose2scan, use the following code to obtain scan number corresponding to the converted dose.

scanNumForDose1 = length(planC{indexS.scan})

On Mon, Sep 5, 2022, 3:40 PM EvandroMolinari1998 @.***> wrote:

When I select the three different dose distributions with the 'doseNum' I compute the same values for the First order statistics features. And when I compare the planC before and after 'planC = dose2scan(doseNum,scanType,gridType,planC);' I realize that there is no difference. How can I fix this?

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

EvandroMolinari1998 commented 2 years ago

Yes! I can see the scan number value changing, but when I try in this next code, it doesn't change This is the code i'm using:

load('ESTUDO_CERR.mat') indexS = planC{end}; doseNum = 1; doseS = planC{indexS.dose}(doseNum); scanType = 'Dose summary'; gridType = 'dose'; planC = dose2scan(doseNum,scanType,gridType,planC); CERR>> Using zValues to compute voxel thicknesses. scanNum = length(planC{indexS.scan}); sampleParamFile =fullfile(getCERRPath,'PlanMetrics','heterogenity_metrics','sample_radiomics_extraction_settings.json'); structNum = 1; ctOffset = 1000; binWidth = 25; statsFeatureS = radiomics_first_order_stats(planC,structNum,ctOffset,binWidth);

EvandroMolinari1998 commented 2 years ago

When I do the whole process and use 'radiomicsFeatS = calcGlobalRadiomicsFeatures(scanNum, structNum, paramS, planC);' to compute the features I get the error:

Unable to perform assignment because the size of the left side is 97-by-162-by-40 and the size of the right side is 283-by-368-by-40. Error in preProcessForRadiomics (line 33) mask3M(:,:,uniqueSlices) = maskUniq3M; Error in calcGlobalRadiomicsFeatures (line 15) [volToEval,maskBoundingBox3M,gridS,paramS] = preProcessForRadiomics(scanNum,...

adityaapte commented 2 years ago

The structure needs to be copied over to the new scan before calling radiomics_first_order_stats. This can be achieved with the following.

planC = copyStrToScan(structNum,scanNum,planC);

Then, use this new structure for feature extraction.

structNum = length(planC{indexS.structures});

On Mon, Sep 5, 2022, 4:27 PM EvandroMolinari1998 @.***> wrote:

Yes! I can see the scan number value changing, but when I try in this next code, it doesn't change This is the code i'm using:

load('ESTUDO_CERR.mat') indexS = planC{end}; doseNum = 1; doseS = planC{indexS.dose}(doseNum); scanType = 'Dose summary'; gridType = 'dose'; planC = dose2scan(doseNum,scanType,gridType,planC); CERR>> Using zValues to compute voxel thicknesses. scanNum = length(planC{indexS.scan}); sampleParamFile =fullfile(getCERRPath,'PlanMetrics','heterogenity_metrics','sample_radiomics_extraction_settings.json'); structNum = 1; ctOffset = 1000; binWidth = 25; statsFeatureS = radiomics_first_order_stats(planC,structNum,ctOffset,binWidth);

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