Open thuhoainguyen opened 1 month ago
I don't understand the second argument this function:
def resample_image(image, new_spacing=[1.0, 1.0, 1.0]):
original_spacing = image.GetSpacing()
original_size = image.GetSize()
Basically, the segmentation_preProc.py
file crop the large axial abominal CT image to get the small specific kidney bound image for further processor techniques.
@thuhoainguyen I think your description is ok but I may need more info:
Next time when you comment pleases tag me (@anhtuduong)
@thuhoainguyen I made a diagram for the classes and the workflow of the code to help you: https://drive.google.com/file/d/1amNT1wPpbPOwA9weN3dbkXe1QY7vUEhF/view?usp=sharing
Thank you very much! I will check tomorrow and let you know.
Buonanotte! hoaithu
On Fri, 24 May 2024 at 00:25 Anh Tu Duong @.***> wrote:
@thuhoainguyen https://github.com/thuhoainguyen I made a diagram for the classes and the workflow of the code to help you:
https://drive.google.com/file/d/1amNT1wPpbPOwA9weN3dbkXe1QY7vUEhF/view?usp=sharing
kits23-preprocessing-class.png (view on web) https://github.com/thuhoainguyen/kits23/assets/76017474/b3648d7d-bdad-49c0-94d4-d5475be01c2e
kits23-preprocessing-workflow.png (view on web) https://github.com/thuhoainguyen/kits23/assets/76017474/5912b7ae-fa27-4095-ad55-71445c6ad39d
— Reply to this email directly, view it on GitHub https://github.com/thuhoainguyen/kits23/issues/1#issuecomment-2128137826, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHR373VFUT5IYBDNC3SNL4DZDZUGDAVCNFSM6AAAAABH3BWR4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRYGEZTOOBSGY . You are receiving this because you were mentioned.Message ID: @.***>
The output of the preprocessing pipeline will differ significantly from the original NIfTI (.nii) images in several ways due to the various preprocessing steps. Here's a detailed explanation of the differences:
Original Image:
Resampled Image:
Original Image:
Normalized Image:
Original Image:
Cropped Image:
In your preprocessing code, the histogram plays a crucial role in normalizing the intensity values of the images. A histogram is a graphical representation of the distribution of intensity values in an image. It consists of bins, where each bin represents a range of intensity values, and the height of each bin represents the number of pixels (or voxels) that fall within that range.
The histograms for different labels are loaded from a precomputed file. This data likely represents the distribution of intensity values for different tissue types (e.g., kidney, tumor, cyst) across the training dataset.
Computing Gaussian Fits:
bin_centers
are calculated to represent the midpoint of each bin.Range Normalization Using Histogram Data:
Standardization:
Contrast Enhancement:
Outlier Handling:
Summary: In summary, the histogram data in your preprocessing code is used to estimate the distribution of intensity values for different tissue types. These distributions are then used to normalize the intensity values of the images, ensuring that they fall within a standardized range. This process enhances the contrast and consistency of the images, making them more suitable for subsequent analysis and machine learning tasks.
First we need to understand what the script does. I suggest you read and comment (line by line) the code flow. If you have any trouble please comment here and we can discuss.