DefDAP icon indicating copy to clipboard operation
DefDAP copied to clipboard

homologous points updated many times if using "update_homog_points" option in set_crop after linking maps with many strain steps in experiment class

Open BenP123 opened this issue 4 months ago • 1 comments

Iterating over dic maps and cropping (with update_homog_points=True) causes the DIC map to be repeatedly cropped

i.e.

for inc, dic_map in exp.iter_over_maps('hrdic'):
    dic_map.link_ebsd_map(ebsd_map, transform_type="affine")
    dic_map.set_crop(left=100,right=100,top=100,bottom=100,update_homog_points=True)

will cause an incorrect update of the homologous points every increment, when we only want to do this once.

Something like this works for now but it would be good to catch this inside defdap

for inc, dic_map in exp.iter_over_maps('hrdic'):
    dic_map.link_ebsd_map(ebsd_map, transform_type="affine")

    if inc == 0: 
        dic_map.set_crop(left=100,right=100,top=100,bottom=100,update_homog_points=True)
    else:
        dic_map.set_crop(left=100,right=100,top=100,bottom=100)

BenP123 avatar Aug 01 '25 10:08 BenP123

We have to think how we want to change the crop behaviour as homologous points are now stored with an experiment frame but crop is still defined on a map. So in a typical HRDIC experiment the homologous points are stored once and the crop many times. One solution is to move the crop definition to the frame but then we'd lose some flexibility with the maps.

mikesmic avatar Aug 04 '25 08:08 mikesmic