Forced2D extraction dimensions

235 views
Skip to first unread message

Max

unread,
Feb 2, 2020, 10:18:52 PM2/2/20
to pyradiomics

Hello expert team,

First of all, thank you for your great work and the creation of this amazing tool!

I have a general question/doubt regarding the settings to use for the 2d extraction. I am confused as to what does pyradiomics treat as x,y and z dimensions? my MRI images are 15 coronal slices of 128x128x15 dimensions in the form x*y*z (15 slices in z-dimension) and when using Forced2D = True and Forced2Ddimension = 0, my understanding is that the dimension that is out-of plane is used for this setting and the document specifies to use 0 for 'ignoring' z-axis but at the same time states that "value 0 identifies the ‘z’ dimension (axial plane feature extraction), and features will be extracted from the xy plane." So, in other words to use 0 for axial acquisition images. Since my images are coronal, do I need to set Forced2Ddimension = 1 for feature extraction from the zx plane according to pyradiomics? 

Also for batchmode extraction, I would like to know what setting parameters need to be added in order to extract 2d wavelet features from only 4 combinations and not wavelet-LLH ; wavelet-LHL ; wavelet-LHH ; wavelet-HLL ; wavelet-HLH ; wavelet-HHL ; wavelet-HHH ; wavelet-LLL combinations and if it is possible to extract LoG features with the setting padDistance = 0?

Thanks,
Max

Renato Cuocolo

unread,
Feb 3, 2020, 4:43:37 AM2/3/20
to pyradiomics
I had simila issues understanding the documentation of the forced 2D extraction settings. The axial plane referenced is always relative to the acquisition plane, so if you want to extract features on the coronal plane from an MRI volume acquired on the coronal plane, as in your example, you should still use the 0 dimension as this corresponds to the axial plane of your acquisition and the coronal plane relative to the patient.
I am going to edit the example parameter files given on github, but I believe the online documentation should also be amended to make these settings more clear. Unfortunately, I am not sure edits can be suggested by users in this case.
As for the wavelet extraction, you should add arguments on your parameter file in the form of a list of filters to apply. If left empty it will default to apply all possible combinations. This is similar to setting sigma values for LoG.
Following the statements by the developers, I believe some padding is necessary for the application of LoG filters even though the extraction only happens within the mask region.

Renato

Joost van Griethuysen

unread,
Feb 4, 2020, 4:50:10 AM2/4/20
to pyradiomics
Hi Max,

I'd just like to weigh in a bit on your second question, regarding the filters.
Am I correct in assuming you only want wavelet applied in the axial plane (relative to aquisition plane, so coronal for your patient)? This would yield the wavelet LH, HL, HH and LL combinations and is enabled when extracting using "force2D"

Second, regarding the LoG, why do you want to set the pad distance to 0? Pad Distance specifies how much voxels around your ROI need to be retained, prior to applying a filter. This enables you to ensure no required information is lost during the pre-cropping done for computational reasons. Especially for LoG and Wavelet filters this is necessary, as they also consider voxels outside of your ROI. Setting the padDistance to 0 will create boundary conditions near the edge of your ROI when applying the LoG filter.
For the computation of features, no padding is added to your ROI, regardless of what padDistance you use, it's just there to allow you to select the best compromise between cropping to enhance performance and retaining an area around your ROI to correctly apply the filters.

I can imagine if this is a bit difficult to understand at first. If you have any suggestions on improving the documentation, I appreciate the help! A fresh pair of eyes can really do wonders for the general understandability!

Regards,

Joost

Op maandag 3 februari 2020 10:43:37 UTC+1 schreef Renato Cuocolo:

Max

unread,
Feb 5, 2020, 11:38:42 AM2/5/20
to pyradiomics
Dear Renato,

Thank you for clarifying the dimensionality question! I guess the key point missing from the documentation is that the plane selection with Force2dDimension is RELATIVE to the acquisition plane; perhaps small addition to the documentation under section "Customizing the Extraction" >> "Forced 2D extraction" >> "force2Ddimension" >> "...Value 0 identifies the ‘z’ dimension (Corresponding to the axial plane feature extraction relative to input image acquisition plane), resulting in features being extracted from the xy plane..." would be helpful for other users.

From additionally reading up, my understanding is that padding is needed in order to avoid reducing input image dimensions and losing information when applying the filters that are required for the particular feature extraction, but the padDistance and filter sizes need to be accurately matched (at least in my case) to avoid leakage of other information into the ROI. It seems that sigma values control the filter size for LoG, but I couldn't find the control parameter for the size of wavelet filter in the documentation. Any idea what the size of it is when using for example 'Wavelet': {}  vs  'Wavelet': {db1} ?

Thanks,
Max

Max

unread,
Feb 5, 2020, 11:48:18 AM2/5/20
to pyradiomics
Dear Joost,

Thank you for your response!

Regarding your first point, you are correct - I only want wavelet applied in the axial plane - so the 4 combinations you mention; and "force2D" appears to work now. I am just unsure how to determine the wavelet filter size, for example 'Wavelet': {} vs 'Wavelet': {db1} 

Regarding the second, to give some context - My MRI images are of lungs and the patients inhale hyper-polarized gas that resides in the entire lung volume, thus this creates an ROI of the entire lung (infact 2 huge ROIs for each of the lungs) and what I am looking to extract are texture features of this gas ventilation throughout the lungs. I had some initial issues with the 'binwidth' due to the big ROIs which overflowed the index variable (int limit is 2^31). But that aside, my mask segmentations cover all of the required image and anything outside of this ROI is therefore noise/unwanted signal (or sometimes set to 0) and requires no padding due to this (unlike in cases where the ROI was a tumor). So my concern is two fold, first that the padding might close the gap between the two ROIs (the two lungs are often very close to each other at the boundaries) and secondly that the information around the ROI is essentially background/noise and the documentation states that "Value of padded voxels are set to original gray level intensity" which I am not sure what original g.l. intensity means? Is it set to g.l. of pixels around the ROI (essentially zero-padding in my case) or is it set to the g.l. value of pixels around the boundary of ROI (data extension) and then later cropping back to original size after filter application? In either case, I would prefer to avoid padding altogether considering our segmentation accuracy and the chance of bleeding-in of other information. Please let me know if these concerns are valid?
With this being said, I tried using padDistance = 5 and my first and second order features did not change in value (As mentioned by Renato above - extraction only happens within the mask region). So will exactly matching the padding distance to the applied filter sizes resolve the features without compromising boundary information after cropping?  (for example using 'padDistance' = 1 for a 3x3 filter?)

Thanks again,
Max
Reply all
Reply to author
Forward
0 new messages