How to get the data of all the opened images

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to get the data of all the opened images

Yiwei Zhang
Hi,

I am writing a plug-in to process the data of multiple images.

If I have opened more than one image file in the Opticks application, how can I get the data of all these image files in my plug-in?

Thanks!

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get the data of all the opened images

dadkins
Administrator

There are multiple ways to do what you want. My first inclination would be to use ModelServices to get all elements of type RasterElement (assuming you are only interested in those). It will return a vector of pointers containing each element created and registered via ModelServices. Then you can just use a standard DataAccessor to get the actual raster data.

 

 

From: Yiwei Zhang [mailto:[hidden email]]
Sent: Tuesday, July 26, 2011 10:46 PM
To: [hidden email]
Subject: [Opticks-devs] How to get the data of all the opened images

 

Hi,

 

I am writing a plug-in to process the data of multiple images.

 

If I have opened more than one image file in the Opticks application, how can I get the data of all these image files in my plug-in?

 

Thanks!


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get the data of all the opened images

tclarke
Administrator
In reply to this post by Yiwei Zhang

You can access all RasterElements using Service<ModelServices>()->getElements(TypeConverter::toString<RasterElement>());

 

From: Yiwei Zhang [mailto:[hidden email]]
Sent: Tuesday, July 26, 2011 10:46 PM
To: [hidden email]
Subject: [Opticks-devs] How to get the data of all the opened images

 

Hi,

 

I am writing a plug-in to process the data of multiple images.

 

If I have opened more than one image file in the Opticks application, how can I get the data of all these image files in my plug-in?

 

Thanks!


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get the data of all the opened images

Kip Streithorst
Administrator

If you want just the image data being viewed in the windows, you should do something like:

 

std::vector<Window*> windows;

Service<DesktopServices>()->getWindows(SPATIAL_DATA_WINDOW, windows);

std::vector<RasterElement*> elements;

for (unsigned int i = 0; I < windows.size(); ++i)

{

    SpatialDataWindow* pWindow = dynamic_cast<SpatialDataWindow*>(windows[i]);

    if (pWindow == NULL)

    {

        continue;

    }

    LayerList* pList = pWindow->getSpatialDataView()->getLayerList();

    elements.push_back(pList->getPrimaryRasterElement());

}

 

 

From: Clarke, Trevor [mailto:[hidden email]]
Sent: Wednesday, July 27, 2011 8:39 AM
To: [hidden email]
Subject: Re: [Opticks-devs] How to get the data of all the opened images

 

You can access all RasterElements using Service<ModelServices>()->getElements(TypeConverter::toString<RasterElement>());

 

From: Yiwei Zhang [mailto:[hidden email]]
Sent: Tuesday, July 26, 2011 10:46 PM
To: [hidden email]
Subject: [Opticks-devs] How to get the data of all the opened images

 

Hi,

 

I am writing a plug-in to process the data of multiple images.

 

If I have opened more than one image file in the Opticks application, how can I get the data of all these image files in my plug-in?

 

Thanks!

 
 
This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Loading...