[ome-devel] image duplicate handling

kris kris at cs.ucsb.edu
Wed Mar 7 01:48:18 GMT 2007


Hi All,

The following patch to ImportEngine.pm radically changed 
our import behavior and unfortunately doesn't detect 
duplicate uploads when  images contain multiple pixel 
attributes, especially when the new pixels are not 
the 'default_pixels'.  Our importers allow different image 
pixels to be added to existing images.

date:        Fri Jul 07 20:44:00 2006 +0000
summary:     Merged IMPORT_CLEANUP_2006-06-27 branch with HEAD


Prior to this, duplicate uploads were detected by hashing the
original file and checking whether the file had been previously
imported.  The current behavior expects that a new image to be 
created in the database and rolled back.  However, the check 
is based on the image's default pixels, which may or may 
not have changed.

It should be  possible to check for duplicate pixels 
by checking for duplicate SHA1 values in the image_pixels.

$image=importGroup(...)
@pixels = findObjects ('@Pixels', { 
        image_id = $image->id()}, _order=>'FileSHA1' );
 # Check for duplicate pixels in same image.
 ...
 # Check for duplicate pixels in other images.
 foreach $p in (@pixels)
  otherpix = findObjects('@Pixels',  { image_id=>['<>', $image->id()})


However, I would like to understand what necessitated the change 
as the previous method seems simpler and, for us, worked well.

If the change is permanent, then the method getSHA1 
should be removed from AbstractFormat (and all descendants)
as it is no longer used.

Thanks,
kris

Attached is the changed code.


-- 
Kristian Kvilekval
kris at cs.ucsb.edu  http://www.cs.ucsb.edu/~kris w:805-636-1599 h:504-9756
-------------- next part --------------
A non-text attachment was scrubbed...
Name: import.change
Type: text/x-patch
Size: 3380 bytes
Desc: not available
Url : http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20070307/1d237bdc/attachment.bin 


More information about the ome-devel mailing list