Alejandro1400 / CellRidgeAnalyzer

0 stars 0 forks source link

[FEAT] Software Automation SOAX #3

Open Alejandro1400 opened 1 month ago

Alejandro1400 commented 1 month ago

For using the SOAX software we need to be able to automatically use the software for each image. This also includes a standarization of the selection of ROIs of the image.

  1. The images need to be accessed directly from a path, so if they are in Box then they should be downloaded in order to use them
  2. The whole tiff could be analyzed but it is computationally expensive and for now we are looking at the edges of the cell. Need to figure out a way of selecting ROIs, for now thinking of how many contours are detected and their length (Finding areas with close enough values for this 2)
  3. Once we have the tiff files the images need to be changed from a tiff to iosotropic voxel size, for this we would use 'Batch Resample' exe from SOAX.
  4. With the isotropic images by using Batch SOAX we can obtain the snakes file, for using this from python we'll need to call the terminal, as well as for step 3. This file would be then saved back in the Data/Box.

This process would be repeated for every image

Alejandro1400 commented 1 month ago

The Download link for the Batch.exe files and manual are:

Alejandro1400 commented 2 weeks ago

To select ROIs I'm going to use the RidgeDetection plugin from ImageJ but I found a version that can be directly used in Python. From this I can detect the lines and junctions from an image. The documentation can be found here:

Alejandro1400 commented 2 weeks ago

The ROI size selection can be user defined, where it gets similar portions of the image as a grid. For now, to follow what we did manually it would be 16 ROIs. This means that for the images, which are 512x512, it would have 128 width and 128 height.

Now, the idea is to select the optimal values for low contrast and high contrast. The width for most of the images analyzed is 2-3 pixels, for which this value can be used. The idea is that these values of the contrast are obtained automatically from the image. From now an idea I have is from the mean value. It is important to remember the definition of the parameters:

image

By looking at the histograms for most of the images, the mean can be considered an estimated cutoff for what is considered the lowest value.

image

Then, the highest can be a value above this, my suggestion is for it to be 1/5 inside the range from the mean to the max value. From this, looking at different images, interesting results were obtained and this can be used as the values for the ridge detector. Remember that this doesn't have to perfect but an estimate for possible regions of interest

image

From Python, when calling the method, all the values need to be inserted, the further options shouldn't be modified but then the selection would be:

The sigma, lower threshold and upper threshold will be calculated from the formulas explained before.

Ridge Detection Wiki

Alejandro1400 commented 2 weeks ago

While testing out the parameters, the results that are gotten are promising. This is when using the values obtained from estimating the lower and higher contrast through mean and std dev of intensity

image