Quantcast

Unable to save Tiffs as "separate image files" in mm2.0

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

Unable to save Tiffs as "separate image files" in mm2.0

Bryant Chhun
Hi folks,

I'm using one of the recent nightly builds of micromanager 2.0 beta (2017/01/09) and am having trouble saving an image as individual tiffs.

For a two channel, multiposition image, selecting the save icon and choosing "separate image files" will save only one position in the series (presumably, the position being viewed), but it will save both channels.  Selecting "save as" and "image sequence" through imageJ also behaves similarly.

Saving as ome.tiff stacks has a different issue -- positions save separately but the channels do not.

I suspect this has something to do with my code and the way the images are constructed.  I used the online guide as reference (https://micro-manager.org/wiki/Using_Builders).

My code:

Datastore store0 = mm.data().createRAMDatastore();
DisplayWindow display1 = mm.displays().createDisplay(store0);

mm.getCore().snapImage();
TaggedImage tmp = mm.getCore().getTaggedImage();
Image channel0 = mm.data().convertTaggedImage(tmp);
channel0 = channel0.copyAtCoords(channel0.getCoords().copy().channel(j).stagePosition(i).build());
store0.putImage(channel0);

where I iterate through i and j for stage position and channel respectively.

Best

Bryant

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to save Tiffs as "separate image files" in mm2.0

Nico Stuurman-2
Hi Bryant,

On 1/17/17 1:47 PM, Bryant Chhun wrote:

> I'm using one of the recent nightly builds of micromanager 2.0 beta
> (2017/01/09) and am having trouble saving an image as individual tiffs.
>
> For a two channel, multiposition image, selecting the save icon and
> choosing "separate image files" will save only one position in the
> series (presumably, the position being viewed), but it will save both
> channels.  Selecting "save as" and "image sequence" through imageJ
> also behaves similarly.
>
> Saving as ome.tiff stacks has a different issue -- positions save
> separately but the channels do not.
>
> I suspect this has something to do with my code and the way the images
> are constructed.  I used the online guide as reference
> (https://micro-manager.org/wiki/Using_Builders).

Can you check if the same thing happens when you use the MM user
interface to collect a two channel, multi-position image?  That will
help figuring out where to look.

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to save Tiffs as "separate image files" in mm2.0

Austin
It may also be helpful to try running MM as an administrator…

> On Jan 17, 2017, at 1:53 PM, Nico Stuurman <[hidden email]> wrote:
>
> Hi Bryant,
>
> On 1/17/17 1:47 PM, Bryant Chhun wrote:
>> I'm using one of the recent nightly builds of micromanager 2.0 beta
>> (2017/01/09) and am having trouble saving an image as individual tiffs.
>>
>> For a two channel, multiposition image, selecting the save icon and
>> choosing "separate image files" will save only one position in the
>> series (presumably, the position being viewed), but it will save both
>> channels.  Selecting "save as" and "image sequence" through imageJ
>> also behaves similarly.
>>
>> Saving as ome.tiff stacks has a different issue -- positions save
>> separately but the channels do not.
>>
>> I suspect this has something to do with my code and the way the images
>> are constructed.  I used the online guide as reference
>> (https://micro-manager.org/wiki/Using_Builders).
>
> Can you check if the same thing happens when you use the MM user
> interface to collect a two channel, multi-position image?  That will
> help figuring out where to look.
>
> Best,
>
> Nico
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to save Tiffs as "separate image files" in mm2.0

Bryant Chhun
Hi Nico, Austin,

If I run using the MDA, everything saves fine.  If I run as administrator, my script still produces the same problem.

Additionally, i tried adding the following line to the end of the code:

store0.setSavePath("D:\\Bryant\\MicroManager\\test\\autosavetest1");
store0.save(Datastore.SaveMode.SINGLEPLANE_TIFF_SERIES, store0.getSavePath());
store0.close();

which produces the following error:

"run-time error : Image <1024x1024x1 image (byte depth 2) at <channel: 1, position: 1, time: 0, z: 0>> does not have a valid positionName metadata value"

so indeed, I think i'm botching the position list metadata in the original code.  If it's obvious to either of you what i'm doing wrong, i'd appreciate your input.  Otherwise I'll work on it more.

Thanks for the help so far!

-Bryant

On Tue, Jan 17, 2017 at 1:56 PM, Austin <[hidden email]> wrote:
It may also be helpful to try running MM as an administrator…

> On Jan 17, 2017, at 1:53 PM, Nico Stuurman <[hidden email]> wrote:
>
> Hi Bryant,
>
> On 1/17/17 1:47 PM, Bryant Chhun wrote:
>> I'm using one of the recent nightly builds of micromanager 2.0 beta
>> (2017/01/09) and am having trouble saving an image as individual tiffs.
>>
>> For a two channel, multiposition image, selecting the save icon and
>> choosing "separate image files" will save only one position in the
>> series (presumably, the position being viewed), but it will save both
>> channels.  Selecting "save as" and "image sequence" through imageJ
>> also behaves similarly.
>>
>> Saving as ome.tiff stacks has a different issue -- positions save
>> separately but the channels do not.
>>
>> I suspect this has something to do with my code and the way the images
>> are constructed.  I used the online guide as reference
>> (https://micro-manager.org/wiki/Using_Builders).
>
> Can you check if the same thing happens when you use the MM user
> interface to collect a two channel, multi-position image?  That will
> help figuring out where to look.
>
> Best,
>
> Nico
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to save Tiffs as "separate image files" in mm2.0

Nico Stuurman-2

On 1/17/17 2:35 PM, Bryant Chhun wrote:

> If I run using the MDA, everything saves fine.
> Additionally, i tried adding the following line to the end of the code:
>
> *store0.setSavePath("D:\\Bryant\\MicroManager\\test\\autosavetest1");*
> *store0.save(Datastore.SaveMode.SINGLEPLANE_TIFF_SERIES,
> store0.getSavePath());*
> *store0.close();*
>
> which produces the following error:
> *
> *
> *"run-time error : Image <1024x1024x1 image (byte depth 2) at
> <channel: 1, position: 1, time: 0, z: 0>> does not have a valid
> positionName metadata value"*
>
> so indeed, I think i'm botching the position list metadata in the
> original code.  If it's obvious to either of you what i'm doing wrong,
> i'd appreciate your input.  Otherwise I'll work on it more.

MetadataBuilder has a function "positionName(String positionName)".

It sure would be nice to know in advance which Metadata are essential
and which ones are "nice to have".

Best,

Nico



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to save Tiffs as "separate image files" in mm2.0

Bryant Chhun
Thanks Nico!  That worked.

To answer your question, we only care about channel and position number.  The rest of the metadata is not useful generally.

I didn't realize I had to build both coords and metadata (or maybe, I don't need to build the coords) if I care about stage position index.

Thanks again!

-Bryant

On Tue, Jan 17, 2017 at 2:59 PM, Nico Stuurman <[hidden email]> wrote:

On 1/17/17 2:35 PM, Bryant Chhun wrote:
> If I run using the MDA, everything saves fine.
> Additionally, i tried adding the following line to the end of the code:
>
> *store0.setSavePath("D:\\Bryant\\MicroManager\\test\\autosavetest1");*
> *store0.save(Datastore.SaveMode.SINGLEPLANE_TIFF_SERIES,
> store0.getSavePath());*
> *store0.close();*
>
> which produces the following error:
> *
> *
> *"run-time error : Image <1024x1024x1 image (byte depth 2) at
> <channel: 1, position: 1, time: 0, z: 0>> does not have a valid
> positionName metadata value"*
>
> so indeed, I think i'm botching the position list metadata in the
> original code.  If it's obvious to either of you what i'm doing wrong,
> i'd appreciate your input.  Otherwise I'll work on it more.

MetadataBuilder has a function "positionName(String positionName)".

It sure would be nice to know in advance which Metadata are essential
and which ones are "nice to have".

Best,

Nico



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...