returns new deinterlaced image if deinterlaced
 OR returns self if no need to deinterlace
422020
def deinterlace
      return self unless interlaced?

      # copy all but 'interlace' header params
      h = Hash[*%w'width height depth color compression filter'.map{ |k| [k.to_sym, hdr.send(k)] }.flatten]

      # don't auto-add palette chunk
      h[:palette] = nil

      # create new img
      new_img = self.class.new h

      # copy all but hdr/imagedata/end chunks
      chunks.each do |chunk|
        next if chunk.is_a?(Chunk::IHDR)
        next if chunk.is_a?(Chunk::IDAT)
        next if chunk.is_a?(Chunk::IEND)
        new_img.chunks << chunk.deep_copy
      end

      # pixel-by-pixel copy
      each_pixel do |c,x,y|
        new_img[x,y] = c
      end

      new_img
    end
890419
def getImage(self):
        '''
        

        '''
        self.lock.acquire()
        image = self.data
        self.lock.release()
        
        return image
1316539
def convert_to_odl(image):
    """"""

    shape = image.shape

    if len(shape) == 2:
        space = odl.uniform_discr([0, 0], shape, shape)
    elif len(shape) == 3:
        d = shape[2]
        shape = shape[:2]
        image = np.transpose(image, (2, 0, 1))
        space = odl.uniform_discr([0, 0], shape, shape) ** d

    image = space.element(image)

    return image
232885
def redraw(self):
        ''''''
        state = self.state

        if self.img is None:
            self.mainSizer.Fit(self)
            self.Refresh()
            state.frame.Refresh()
            self.SetFocus()
            return

        # get the current size of the containing window frame
        size = self.frame.GetSize()
        (width, height) = (self.img.GetWidth(), self.img.GetHeight())

        rect = wx.Rect(self.dragpos.x, self.dragpos.y, int(size.x/self.zoom), int(size.y/self.zoom))

        #print("redraw", self.zoom, self.dragpos, size, rect);

        if rect.x > width-1:
            rect.x = width-1
        if rect.y > height-1:
            rect.y = height-1
        if rect.width > width - rect.x:
            rect.width = width - rect.x
        if rect.height > height - rect.y:
            rect.height = height - rect.y

        scaled_image = self.img.Copy()
        scaled_image = scaled_image.GetSubImage(rect);
        scaled_image = scaled_image.Rescale(int(rect.width*self.zoom), int(rect.height*self.zoom))
        if state.brightness != 1.0:
            try:
                from PIL import Image
                pimg = mp_util.wxToPIL(scaled_image)
                pimg = Image.eval(pimg, lambda x: int(x * state.brightness))
                scaled_image = mp_util.PILTowx(pimg)
            except Exception:
                if not self.done_PIL_warning:
                    print("Please install PIL for brightness control")
                    self.done_PIL_warning = True
                # ignore lack of PIL library
                pass
        self.imagePanel.set_image(scaled_image)
        self.need_redraw = False

        self.mainSizer.Fit(self)
        self.Refresh()
        state.frame.Refresh()
        self.SetFocus()
        '''
        from guppy import hpy
        h = hpy()
        print h.heap()
        '''
459893
public void cleanup(boolean reuse, boolean wasInsert)
    {
        if(currentImage != null)
        {
            performImageCleanup(currentImage, reuse);
        }
        if(beforeImage != null)
        {
            // we always free all resources of the old image
            performImageCleanup(beforeImage, false);
        }
        if(reuse)
        {
            refreshObjectImage(wasInsert);
        }
        else
        {
            myObj = null;
        }
    }
463841
def get_image(self, img, is_train):
        """"""
        img_arr = mx.image.imread(img)
        img_arr = transform(img_arr, 256, 256, is_train, self.boxes[img])
        return img_arr
833129
def image(self):
        
        self._image = self.genImage()
        self._image = funcs.rotateImage(self._image, self.direction)
        return self._image
1136773
def image(self):
        """"""
        if self._image is None:
            self._populate_from_rasterio_object(read_image=True)
        return self._image
772554
private static ImageDescriptor createUnManaged(String prefix, String name)
	{
		return create(prefix, name, true);
	}
162243
function Image() {
  if (!this) return new Image();

  this.url = null;

  EventEmitter.call(this);

  setTimeout(function timeout() {
    if (this.onerror) this.on('error', this.onerror);
    if (this.onload) this.on('load', this.onload);
  }.bind(this));
}
317555
function( src ) {

            $.makeTransparentImage = function( src ){
                var img = $.makeNeutralElement( "img" );

                img.src = src;

                return img;
            };

            if ( $.Browser.vendor == $.BROWSERS.IE && $.Browser.version < 7 ) {

                $.makeTransparentImage = function( src ){
                    var img     = $.makeNeutralElement( "img" ),
                        element = null;

                    element = $.makeNeutralElement("span");
                    element.style.display = "inline-block";

                    img.onload = function() {
                        element.style.width  = element.style.width || img.width + "px";
                        element.style.height = element.style.height || img.height + "px";

                        img.onload = null;
                        img = null;     // to prevent memory leaks in IE
                    };

                    img.src = src;
                    element.style.filter =
                        "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                        src +
                        "', sizingMethod='scale')";

                    return element;
                };

            }

            return $.makeTransparentImage( src );
        }
919357
def image(self):
        
        if self._image is None:
            self._image = Image(self.fname)
        return self._image
326687
function(imageIdentifier, callback) {
        var url = this.getMetadataUrl(imageIdentifier);

        request.del(this.getSignedResourceUrl('DELETE', url), callback);
        return this;
    }
1172454
function(imageIdentifier, callback) {
        this.headImage(imageIdentifier, function(err, res) {
            if (err) {
                return callback(err);
            }

            var headers = res.headers,
                prefix = 'x-imbo-original';

            callback(err, {
                width: parseInt(headers[prefix + 'width'], 10),
                height: parseInt(headers[prefix + 'height'], 10),
                filesize: parseInt(headers[prefix + 'filesize'], 10),
                extension: headers[prefix + 'extension'],
                mimetype: headers[prefix + 'mimetype']
            });
        });

        return this;
    }
1028959
def from_nibabel(nib_image):
    
    tmpfile = mktemp(suffix='.nii.gz')
    nib_image.to_filename(tmpfile)
    new_img = iio2.image_read(tmpfile)
    os.remove(tmpfile)
    return new_img
1026372
def image(img = nil)
      return @image if img.nil?
      ImageGC.instance.add(img.id) if @options[:rm]
      @image = img
    end
1006123
def baseimage(self, new_image):
        
        images = self.parent_images or [None]
        images[-1] = new_image
        self.parent_images = images