A demo for NPDS calculation
The purpose of this online tool is to demonstrate how the NPDS method, proposed in the referenced paper "A Novel Statistic Guided by Clinical Experience
for Assessing the Progression of Lung Nodules", can be used to determine whether a lung nodule has progressed or not.
We have prepared two CT images of nii format for illustration, which includes a total of five steps to obtain the NPDS value and its corresponding $P-$value.
from NPDSlib import NPDS_Hypothesis_Testing as NPDS_HT
# CT paths
baseline_CT_nii_path = './Data/patient1_baseline.nii.gz'
followup_CT_nii_path = './Data/patient1_followup.nii.gz'
# nodule position and diameter in follow-up CT
X=129
Y=288
range_Z = '122-141'
diameter = 12 # unit mm
The coordinates ("X","Y") represent the center of the nodule.
The "range_Z" represents the nodule's coverage along the Z-axis.
The "diameter" represents the maximum diameter of the nodule, measured in millimeters (mm).
nodule_progress_detector = NPDS_HT(X, Y, range_Z, diameter, baseline_CT_nii_path, followup_CT_nii_path)
baseline CT size : (447, 512, 512) follow-up CT size : (520, 512, 512) Initialization complete.
The registration between the two CT scans is performed using the classical Elastix algorithm.
When performing the registration, it is important to ensure that the slice thickness of the two CT scans does not differ significantly.
nodule_progress_detector.registration_by_elastix()
Running registration algorithm... Registration complete. baseline CT size : (520, 512, 512) follow-up CT size : (520, 512, 512)
Extract the lung mask for excluding any noise outside the lung tissue.
nodule_progress_detector.get_segmented_lungs()
Running lung mask extraction ... Lung mask extraction complete.
Visualize the preprocessed basline CT slices as a GIF.
nodule_progress_detector.visualize_ct_slices_as_gif(nodule_progress_detector.bf_sub_image, gif_path='./Data/baseline_CT_slices_example.gif')
Visualize the preprocessed follow-up CT slices as a GIF.
nodule_progress_detector.visualize_ct_slices_as_gif(nodule_progress_detector.af_sub_image, gif_path='./Data/followup_CT_slices_example.gif')
As illustrated in the GIF images of the two CT scans above, the nodule enclosed by the red anchor box shows significant progression in the follow-up scan compared to the baseline scan.
Calculate the NPDS-index.
nodule_progress_detector.NPDS_calculate()
Hypothesis testing.
nodule_progress_detector.hypothesis_test_by_ClinvNod_sample()
NPDS : 0.2347265625 Progression Prediction Result : True p_value : 0.0109708446
Conclusion
From Step 5, it can be observed that the nodule's NPDS is $0.2347$ . At a 5% significance level, the hypothesis testing result indicates that the nodule is progressive, with a $P-$value of $0.01 < 0.05$.
How to construct your own NPDS ?
The purpose of this online tool is to statically demonstrate the process of NPDS calculation and hypothesis testing. If you want to use your own CT images to construct NPDS, please download the code and its dependencies from https://github.com/hangyustat/NPDS, which will enable you to calculate NPDS on your own PC.
Before that, make sure :