Index: /fact/tools/pyscripts/tools/cleaning/area_vs_size.py
===================================================================
--- /fact/tools/pyscripts/tools/cleaning/area_vs_size.py	(revision 13130)
+++ /fact/tools/pyscripts/tools/cleaning/area_vs_size.py	(revision 13131)
@@ -14,4 +14,5 @@
 import time as t
 from cleaners import AmplitudeCleaner
+from image_extractors import SimpleArea, SimpleSize
 confirm_next_step = False# this is for user interaction
 
@@ -30,4 +31,6 @@
 extract = GlobalMaxFinder(40,200)
 cleaner = AmplitudeCleaner(45,18)
+area = SimpleArea()
+size = SimpleSize()
 
 #plotA = CamPlotter('amplitudes')
@@ -47,23 +50,8 @@
         data = smooth(data)
         amplitude, time_of_max = extract(data)
-        clean_mask = cleaner(amplitude)
-        #plotA.name='amplitudes EvtID:' + str(run.event_id.value) + ' TT:' + str(tt)
-        #plotA(amplitude)
-        #plotT(time_of_max)
-        #plotCA(data=amplitude, mask=clean_mask)
-        
-        survivors = np.where( clean_mask)[0]
-        size = 0
-        for pixel in survivors:
-            size += amplitude[pixel]
-        
-        if len(survivors) > 0:
-            areas.append( len(survivors) )
-            sizes.append( size )
-        
-        
-        #plotArea(areas, 'areas of ' + str(run.event_id.value) + 'events')
-        #plotSize(sizes, 'sizes of ' + str(run.event_id.value) + 'events')
-        
+        survivors = cleaner(amplitude, return_bool_mask=False )
+        areas.append( area(survivors) )
+        sizes.append( size(survivors) )
+
         if confirm_next_step:
             user_input = raw_input("'q'-quit, 'r'-run, anything else goes one step")
