FranckLab / FIDVC

Fast Iterative Digital Volume Correlation Algorithm
31 stars 18 forks source link

Code update and strain map resolution of binary image volumes #24

Closed ragyei closed 5 years ago

ragyei commented 6 years ago

Hi, I have a comment and a question,

I was currently using the FIDVC software and encountered an error message I want to bring your attention to. In the checkConvergenceSSD.m line 75 ensures that the idx term evaluated in line 74 does not index a zero else it throws an out of dimension error. I believe the same should be done in line 91 to ensure that if the spacing is 8 voxels then the idx computed in line 90 should not encounter an out of dimension error. This error was not encountered because the minimum subset spacing was 32^3 and the subset spacing was set to 0.5subset_size. however, if we set the subset spacing to 0.25subset_size then I believe that update is necessary.

Secondly, I transformed my 3D image volumes into binary images where fibers are all of value one and matrix is zeros and this became my input for image volumes for the FIDVC code. This is to avert the influence of highly noisy and sporadic intensities in my 3D images. However, I am still not getting highly resolved strain maps. At the moment I am using the most refined parameters available in the FIDVC code(subset size of 32 by 32 by 32 and a subset spacing of 8 voxels). Any further suggestions?

Thanks. Ron.

ALandauer commented 6 years ago

Hi Ron, Good point, I do not see a convincing reason why idx in that line is not checked for zeros. I will look into it further and probably update it on GitHub.

Binarization is very unlikely to improve your results. I would recommend against using binary images in basically all situations, since the information content of your images is dramatically reduced and matching is no longer well defined. Matching relies on steep non-singular intensity gradients in the images. Some alternative means of filtering your images may help reduce noise (e.g. median or Gaussian), although without more information or being able to see the images I hesitate to say. Also, the strain spatial frequency resolution will depend not only on the displacement reconstruction parameters in FIDVC (i.e. subset size and spacing) but also on whatever strain kernel you have chosen to employ. It is likely possible to reduce minimum subset sizes or spacing further. You would need to modify the code and make sure to re-evaluate and make sure everything work properly.

Regards, Alex L

ragyei commented 6 years ago

Thanks for the suggestions, Alex. Before going down the route modifying the code to minimize the subset spacing, I will like to know what you mean by strain kernel since that is a factor the strain resolution depends on. If this helps, the displacement gridpoints obtained from the FIDVC are at every 8 pixels since "dm is set to the default". So to obtain the full-field displacement at each point, I use linear interpolation from MATLAB's griddedInterpolant. I then generate Cauchy strain at each gridded point points to generate my full-field strain (where the partial derivative terms are obtained using MATLAB's gradient function). Is there anything I am missing? Thanks. Ron.

ALandauer commented 5 years ago

Hi Ron, Typically, direct measurement such as you describe is noisy, since you are taking the spatial derivative of an already somewhat noisy displacement signal. Matlab's "gradient" uses a central differencing scheme that is effectively quite similar to a Prewitt filter, which is a pretty basic 3x3 filter. A good way to mitigate this noise is to use a more sophisticated spatial differentiation filter kernel (e.g. an optimal n-tap or similar - see the section on page 266 of the paper) to determine stain. The amount of spatial averaging of the strain will depend on the size of the differentiation kernel.

Regards, Alex L

ALandauer commented 5 years ago

Closing due to inactivity.