nagyistoce / platinum-image

Automatically exported from code.google.com/p/platinum-image
0 stars 0 forks source link

Datawidgets showing for images not added to datamanagement #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Datawidget should only be created for images destined for datamanagement

Original issue reported on code.google.com by arvi...@gmail.com on 28 May 2007 at 12:30

GoogleCodeExporter commented 9 years ago

Original comment by arvi...@gmail.com on 18 Jun 2007 at 9:36

GoogleCodeExporter commented 9 years ago
the activate() method in data_base is now called when a data object (e.g. 
image) is added to datamanager. The 
current behavior is simply to activate the previously deactivated (grayed out) 
image. This way, images that are 
memory leaks and not supposed to be left are exposed, but not confused for 
added images.

There are other possible behaviors, let me know what you think.

Original comment by arvi...@gmail.com on 12 Jul 2007 at 3:39

GoogleCodeExporter commented 9 years ago
The fix is in the upcoming commit, coming Real Soon

Original comment by arvi...@gmail.com on 12 Jul 2007 at 3:39

GoogleCodeExporter commented 9 years ago
How can I avoid getting memory leaks when using scalar_copycast?

image_integer<unsigned char, 3> * body_image = 
dynamic_cast<image_integer<unsigned 
char, 3> *>(datamanagement.get_image(userIOmanagement.get_parameter<imageIDtype>
(userIO_ID,0)));
if(body_image==NULL)
  {
  image_integer<short, 3> * temp_image = dynamic_cast<image_integer<short, 3> *>
(datamanagement.get_image(userIOmanagement.get_parameter<imageIDtype>(userIO_ID,
0)));
  if(temp_image!=NULL)
    {
    int temp_image_id=datamanagement.last_image();      
    temp_image->scale(0,255);
    body_image = scalar_copycast<image_integer, unsigned char, 3>(temp_image);
    }
  }
  //How do I remove temp_image ???
}

Original comment by petter.r...@gmail.com on 7 Aug 2007 at 6:40

GoogleCodeExporter commented 9 years ago
Would it be possible to avoid the call 
widget=new datawidget<image_base>(this,namestream.str());    
in image_base::set_parameters ()  
when using scalar_copycast()? 
It seems to be there the widgets for images not added are created.

Original comment by petter.r...@gmail.com on 7 Aug 2007 at 9:21

GoogleCodeExporter commented 9 years ago
Made it possible to remove temp_image (see comment 4) in revision 379

Original comment by petter.r...@gmail.com on 7 Aug 2007 at 4:30

GoogleCodeExporter commented 9 years ago
Re: 5 See comment 2, widgets are shown to indicate that the image exists - to 
avoid memory leaks. The real "fix" 
would be to hide rather than deactivate unadded images, but then image memory 
leaks would go unnoticed.

Original comment by arvi...@gmail.com on 14 Aug 2007 at 10:24