Module Import alias Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr TryExcept body Import alias handlers ExceptHandler body Import alias Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Import alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Import alias Import alias ImportFrom alias Import alias Import alias ImportFrom alias Import alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareEq BinOpMod NameLoad Num Num body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Print BinOpSub Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Str Expr Str Assign NameStore BinOpDiv Num Num Assign NameStore AttributeLoad NameLoad attr TryExcept body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr handlers ExceptHandler body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr orelse Assign TupleStore NameStore NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore ListComp Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr BinOpDiv NameLoad NameLoad comprehension NameStore NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpSub BinOpDiv BinOpDiv Call AttributeLoad NameLoad attr Num NameLoad BinOpDiv Call AttributeLoad NameLoad attr Num BinOpSub BinOpDiv BinOpDiv Call AttributeLoad NameLoad attr Num NameLoad BinOpDiv Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Num Num NameLoad Assign NameStore Num For NameStore AttributeLoad AttributeLoad NameLoad attr attr body For NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num BinOpDiv NameLoad Num BinOpSub SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num BinOpDiv NameLoad Num NameLoad NameLoad For NameStore AttributeLoad AttributeLoad NameLoad attr attr body For NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr body If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore BinOpAdd NameLoad Num If CompareEq NameLoad Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num If CompareEq Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr
N/A N/A logging N/A N/A N/A logging basicConfig level N/A logging ERROR N/A N/A N/A cmt.ee_authenticate N/A N/A N/A N/A sys N/A os.path N/A N/A N/A N/A sys path append N/A N/A N/A os path join N/A N/A N/A os path dirname N/A N/A N/A os path realpath __file__ .. N/A cmt.ee_authenticate N/A N/A N/A N/A cmt ee_authenticate initialize N/A time N/A cmt.domain cmt.radar.active_contour * N/A sys N/A PIL PIL ImageQt N/A numpy PyQt4 QtGui QtCore N/A app N/A N/A QtGui QApplication N/A sys argv N/A THIS_FILE_FOLDER N/A N/A N/A os path dirname N/A N/A N/A os path realpath __file__ N/A domain N/A N/A N/A cmt domain Domain N/A N/A N/A N/A os path join THIS_FILE_FOLDER .. /config/domains/skybox/new_bedford_2014_10.xml active_contour_step N/A N/A local_image snake step N/A N/A N/A Perform another step of the active contour algorithm N/A N/A snake done N/A N/A True N/A t N/A N/A time time N/A N/A N/A step 10 0 N/A N/A N/A N/A snake respace_nodes N/A N/A N/A snake shift_nodes N/A N/A N/A snake fix_geometry N/A N/A N/A N/A snake shift_nodes N/A N/A N/A N/A time time t N/A False N/A ActiveContourWindow N/A N/A QtGui QWidget N/A N/A Dedicated class for drawing the progress of the active contour algorithm __init__ N/A N/A self domain N/A N/A N/A N/A N/A N/A super ActiveContourWindow self __init__ N/A N/A N/A self setGeometry 300 300 650 650 N/A N/A N/A self setWindowTitle Active Contour N/A N/A self domain domain N/A 
        Fetch image and compute statistics
        sensor         = domain.get_radar()
        detect_channel = domain.algorithm_params['water_detect_radar_channel']
        ee_image       = sensor.image.select([detect_channel]).toUint16()
        if sensor.log_scale:
            statisics_image = ee_image.log10()
        else:
            statisics_image = ee_image
        (band_names, band_statistics) = compute_band_statistics(statisics_image, domain.ground_truth, domain.bounds)

        (self.local_image, self.snake) = initialize_active_contour(domain, ee_image, band_statistics, sensor.log_scale)

         Retrieve the local image bands and merge them into a fake RGB image
        channels = [self.local_image.get_image(detect_channel), self.local_image.get_image(detect_channel), self.local_image.get_image(detect_channel)]
        channel_images = [PIL.Image.fromarray(numpy.uint8(c*255/1200)) for c in channels]  Convert from 16 bit to 8 bit
        self.display_image = PIL.Image.merge('RGB', channel_images)
        self.step = 1
        self.show()
         N/A 
        Initialize the contour with the selected sensor band
        sensor_name = 'uavsar'
        sensor      = getattr(domain, sensor_name)
        ee_image    = sensor.image.select(['hh'])

        # TODO: Make sure the name and statistics line up inside the class!
        # Compute statistics for each band -> Log10 needs to be applied here!
        (band_names, band_statistics) = compute_band_statistics(statisics_image, domain.ground_truth, domain.bounds)

        (self.local_image, self.snake) = initialize_active_contour(domain, ee_image, band_statistics, sensor.log_scale)

        # Retrieve the local image bands and merge them into a fake RGB image
        #channels = [self.local_image.get_image('hh'), self.local_image.get_image('hv'), self.local_image.get_image('vv')]
        channels = [self.local_image.get_image('hh'), self.local_image.get_image('hh'), self.local_image.get_image('hh')]
        channel_images = [PIL.Image.fromarray(numpy.uint8(c >> 8)) for c in channels] # Convert from 16 bit to 8 bit
        self.display_image = PIL.Image.merge('RGB', channel_images)
        self.step = 1
        self.show()
         N/A SKYBOX_SCALE N/A 1200 256 N/A train_domain N/A domain training_domain N/A N/A N/A sensor N/A domain skybox N/A trainSensor N/A train_domain skybox N/A N/A N/A N/A sensor N/A domain skybox_nir N/A trainSensor N/A train_domain skybox_nir N/A ee_image N/A N/A N/A sensor image toUint16 N/A ee_image_train N/A N/A N/A trainSensor image toUint16 N/A N/A train_domain training_features N/A N/A N/A band_names band_statistics N/A compute_band_statistics_features ee_image_train N/A train_domain training_features N/A N/A N/A band_names band_statistics N/A compute_band_statistics ee_image_train N/A train_domain ground_truth N/A train_domain bounds N/A N/A N/A self local_image N/A self snake N/A initialize_active_contour domain ee_image band_statistics False N/A channels N/A N/A N/A N/A self local_image get_image Red N/A N/A N/A self local_image get_image Green N/A N/A N/A self local_image get_image Blue N/A channel_images N/A N/A N/A N/A PIL Image fromarray N/A N/A numpy uint8 N/A c SKYBOX_SCALE N/A c channels N/A N/A self display_image N/A N/A N/A PIL Image merge RGB channel_images N/A N/A self step 1 N/A N/A N/A self show N/A paintEvent N/A N/A self event N/A N/A N/A imageqt N/A N/A ImageQt ImageQt N/A self display_image N/A p N/A N/A QtGui QPainter N/A N/A N/A p begin self N/A N/A N/A p setRenderHint N/A N/A QtGui QPainter Antialiasing True N/A scale N/A N/A N/A self height N/A float N/A N/A N/A imageqt height 10 N/A N/A N/A p scale scale scale N/A N/A N/A p translate N/A N/A N/A N/A N/A self width 2 scale N/A N/A N/A imageqt width 2 N/A N/A N/A N/A N/A self height 2 scale N/A N/A N/A imageqt height 2 N/A N/A N/A p fillRect 0 0 N/A N/A imageqt width N/A N/A imageqt height N/A N/A QtGui QColor 0 0 0 N/A N/A N/A p drawImage 0 0 imageqt N/A NODE_RADIUS 4 N/A loop N/A N/A self snake loops N/A N/A i N/A range N/A len N/A loop nodes N/A N/A N/A N/A p setPen N/A N/A QtGui QColor 255 0 0 N/A N/A N/A p setBrush N/A N/A QtGui QBrush N/A N/A QtGui QColor 255 0 0 N/A N/A N/A p drawEllipse N/A N/A N/A N/A loop nodes N/A i N/A 1 N/A NODE_RADIUS 2.0 N/A N/A N/A N/A loop nodes N/A i N/A 0 N/A NODE_RADIUS 2.0 NODE_RADIUS NODE_RADIUS N/A loop N/A N/A self snake loops N/A N/A i N/A range N/A len N/A loop nodes N/A N/A N/A N/A len N/A loop nodes 1 N/A N/A n N/A i 1 N/A N/A n N/A len N/A loop nodes N/A N/A n 0 N/A N/A N/A p setPen N/A N/A QtGui QColor 0 255 0 N/A N/A N/A p drawLine N/A N/A N/A loop nodes N/A i N/A 1 N/A N/A N/A loop nodes N/A i N/A 0 N/A N/A N/A loop nodes N/A n N/A 1 N/A N/A N/A loop nodes N/A n N/A 0 N/A N/A N/A p end N/A keyPressEvent N/A N/A self event N/A N/A N/A Update the algorithm on space, quit on "q" N/A N/A N/A N/A event key N/A N/A QtCore Qt Key_Space N/A N/A N/A active_contour_step N/A self local_image N/A self snake N/A self step N/A N/A N/A self repaint N/A N/A self step 1 N/A N/A N/A N/A event key N/A N/A QtCore Qt Key_Q N/A N/A N/A N/A N/A QtGui QApplication quit N/A N/A N/A ex N/A ActiveContourWindow domain N/A N/A N/A sys exit N/A N/A app exec_