ibrahimethemhamamci / CT-CLIP

Developing Generalist Foundation Models from a Multimodal Dataset for 3D Computed Tomography
200 stars 21 forks source link

Finetune on custom dataset. #28

Closed GYDDHPY closed 2 months ago

GYDDHPY commented 2 months ago

Thank you for your great contribution to the field.

I’m currently working with a dataset and looking to apply your pretrained model. However, I’m unsure about how to handle the rescale intercept and slope values for my data. Upon reviewing the CT-RATE dataset meta information using ITK-SNAP, I noticed that the intercept and slope values are 0 and 1, which is consistent with my dataset. However, in the meta CSV file provided in your repository, I see intercept values like -8192.

Could you kindly provide some guidance on how to determine the correct rescale intercept and slope values for my dataset when using your model? Any advice would be greatly appreciated.

Looking forward to your response.

sezginerr commented 2 months ago

Hi @GYDDHPY,

The intercept and slope values in the nii.gz files are the default ones applied during the nii.gz saving process, so they are unrelated to the dataset, as I didn’t explicitly define them. I will update the entire dataset with int16 precision and corrected headers (so the slope and intercept values will be fixed in the nii.gz headers as well).

The intercept and slope values in the metadata CSV file are accurate and derived from the DCM metadata. If your dataset already contains values saved in HU (Hounsfield Units), you don’t need to apply any further conversion using intercept and slope. However, if you’re working with raw DCM files (which are often saved with a different range than HU for memory optimization) or the pixel values (not HUs) from DCM images saved as nii.gz or npz files, you will need to apply the intercept and slope for the transformation.

GYDDHPY commented 2 months ago

Thank you for your quick reply. I believe my images are already rescaled to Hounsfield units (HU). I will proceed with testing the model to see if the performance meets expectations.