lmbneuron / D-LMBmap

29 stars 5 forks source link

segmentation fails with raw data #5

Closed louispivron closed 2 months ago

louispivron commented 3 months ago

Dear developers, I'm using D-LMBmap to register adult mouse brains from Clarity LSFM scans and perform ROI segmentation and soma detection.

The segmentation resulted on poor results due probably to the quality of the data or insufficient pre-processing.

The raw data was cropped and resized to the registration standards 264x228x160.

image image image

The Allen style transfer seems pretty decent though, what do you think ?

Would you advice something in the preprocessing steps to ensure optimal image quality ?

Could you tell me more about the data that you used and the pre-processing for the tutorial which works amazingly well with the software...

Thanks a lot for your time !

Appreciate your help,

Louis

Lilia137 commented 3 months ago

Hi Louis, We have checked the problem you mentioned, and here are some possible suggestions.

In the result of the style transfer, we think that the transferred brain edge is still OK. But the middle section is poor maybe due to imaging problems with the raw data. If the raw image quality is better, the effect of style transfer should be better.

Based on the raw data you provided, the main problem is that there are voids and sagittal stripes in the brain stem. Our data basically doesn't have this problem (as shown in the picture). 02d25a85ef1af77b9f271c0f11896b8

For data preprocessing, we use histogram average and normalization methods, which can deal with the brightness of the whole image. You can find the preprocessing script in Whole Brain Registration/ms_regnet/preprocess/pipeline.ipynb of this repository. However, for the problems of stripes and voids, you may need to improve the quality of the imaging or find some effective image processing algorithms to solve these problems.

louispivron commented 3 months ago

Hello @Lilia137, thanks a lot for your quick response !

Indeed the data is not super good, that's why I have also tried with much better quality data coming from Brainglobe/Brainreg registration tool.

I can share it with you here : https://drive.google.com/drive/folders/111yLis6RGWxF5Mebup6y41aq4Wyc5-Vq?usp=sharing

Maybe you can try on your side and tell me if it worked for you or not.

But according to the images below, the segmentation should yield way better results no ? registration-1

registration-2

Also the registration process crashes with the following error message :

error

I guess that since all the different regions are not found, the registration cannot be executed properly. Can it be something else ?

Really appreciate your help !

Lilia137 commented 3 months ago

Hi Louis, We used the data you provided, and tried to use the software to perform brain segmentation operation, and found that the effect was not very good. We found that most of the errors occurred in areas near the stripes where the color was uneven. I would like to ask you how long the light wave is for data acquisition? We imaged it on a 488nm channel, and instead of using a partition scan, we scanned the entire brain. The splicing area of your data may be the main cause of the uneven brightness.

If the tests still don't live up to expectations, we suggest that you can use our code to train your own model. Of course, this requires additional data annotation work to train or fine-tune the entire model.

As for the error reported in the registration process you showed, could you please provide a complete screenshot of the terminal so that we can locate the specific code of the error location? Thank you very much!