ome / omero-cli-transfer

An OMERO CLI plugin for creating transfer packets between OMERO servers.
https://pypi.org/project/omero-cli-transfer/
GNU General Public License v2.0
14 stars 13 forks source link

Attribute "Name" not set when importing a .czi file #87

Closed technics3 closed 1 month ago

technics3 commented 4 months ago

When trying to import a dataset with .tif and .czi files, both of them are well imported but the name appears blank on Omero Web.

When investigating on the issue it appears that the "Name" attribute on transfer.xml generated by omero-cli-transfer is empty :

<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
  <Image ID="Image:1" Name="">
    <Pixels ID="Pixels:1" DimensionOrder="XYCZT" Type="uint16" SizeX="1800" SizeY="1300" SizeZ="1" SizeC="2" SizeT="240">
      <MetadataOnly/>
    </Pixels>
    <AnnotationRef ID="Annotation:1"/>
    <AnnotationRef ID="Annotation:2"/>
  </Image>
  <Image ID="Image:2" Name="MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1_Labels.tif">
    <Pixels ID="Pixels:2" DimensionOrder="XYCZT" Type="uint8" SizeX="1800" SizeY="1300" SizeZ="1" SizeC="3" SizeT="1">
      <MetadataOnly/>
    </Pixels>
    <AnnotationRef ID="Annotation:3"/>
    <AnnotationRef ID="Annotation:4"/>
  </Image>
[...]

The ls output :

omero@nte-omero-server:~$ ls -alh /mnt/SHARE/S-BIAD564/Centrin4-overexpression/AK008/
total 4.3G
drwx------ 1 omero nogroup    0 Jun 17 14:04 .
drwx------ 1 omero nogroup    0 Jun 17 09:39 ..
-rw------- 1 omero nogroup 2.1G Jun 17 09:40 MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1.czi
-rw------- 1 omero nogroup 6.7M Jun 17 09:40 MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1_Labels.tif
-rw------- 1 omero nogroup 2.1G Jun 17 09:41 MAX_AK008_3dpf_px017um_z0_5um_t30sec_Fish3.czi
-rw------- 1 omero nogroup 9.0M Jun 17 09:41 MAX_AK008_3dpf_px017um_z0_5um_t30sec_Fish3_labels.tif
-rw------- 1 omero nogroup  49M Jun 17 09:41 MAX_AK008_Fish3_Cell1-representative.tif
-rw------- 1 omero nogroup 9.4K Jun 17 14:04 transfer.xml
-rw------- 1 omero nogroup 9.4K Jun 17 13:59 transfer.xml.bak

Everything is up to date, i can provide any additional log, metadata or the original image file if needed.

@glyg

erickmartins commented 3 months ago

How was this pack generated? I could not reproduce the problem with generic images on my end. It seems like the problem is on the pack end of things - unpack will just use whatever is on the XML for the image names.

technics3 commented 3 months ago

Hello, This was encountered when running omero transfer prepare, not pack or unpack.

erickmartins commented 3 months ago

Can you run showinf MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1_Labels.tif and post the result back here? For multi-image files, omero-cli-transfer relies on what showinf returns - if it returns an empty name, it should still add have "0" as its name. For single-image files, it should use whatever showinf returns as the image name - maybe it's returning an empty string.

technics3 commented 1 month ago

For the *.tif files showinf is working correctly :

(quay) omero@nte-omero-server:~$ showinf AK008/MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1_Labels.tif -nopix -omexml-only -no-sas -noflat
<?xml version="1.0" encoding="UTF-8"?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
   <Image ID="Image:0" Name="MAX_AK008_3dpf_px017um_z0.53um_t30sec_Fish1_Labels.tif">
      <Description/>
      <Pixels BigEndian="true" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" SignificantBits="8" SizeC="3" SizeT="1" SizeX="1800" SizeY="1300" SizeZ="1" Type="uint8">
         <Channel ID="Channel:0:0" SamplesPerPixel="3">
            <LightPath/>
         </Channel>
         <MetadataOnly/>
      </Pixels>
   </Image>
</OME>

But if i try the same with the *.czi files, i got an empty value for the Name attribute :

<?xml version="1.0" encoding="UTF-8"?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
   <Experimenter ID="Experimenter:0" UserName="k.moeller"/>
   <Instrument ID="Instrument:0">
      <Microscope/>
      <Detector AmplificationGain="0.0" Gain="1.0" ID="Detector:0:0" Model="Edge" Type="Other" Zoom="1.4"/>
      <Detector AmplificationGain="0.0" Gain="0.0" ID="Detector:1:0" Model="Edge" Type="Other" Zoom="1.4"/>
      <Objective ID="Objective:0" Immersion="Water" LensNA="1.0" Model="W Plan-Apochromat 20x/1.0 UV-VIS_4909000040" NominalMagnification="20.0"/>
      <FilterSet ID="FilterSet:0:0:0">
         <EmissionFilterRef ID="Filter:0:0:0"/>
      </FilterSet>
      <FilterSet ID="FilterSet:1:0:0">
         <EmissionFilterRef ID="Filter:1:0:0"/>
      </FilterSet>
      <Filter ID="Filter:0:0:0"/>
      <Filter ID="Filter:1:0:0"/>
   </Instrument>
   <Image ID="Image:0" Name="">
      <ExperimenterRef ID="Experimenter:0"/>
      <InstrumentRef ID="Instrument:0"/>
      <ObjectiveSettings ID="Objective:0" Medium="Water" RefractiveIndex="1.333"/>
      <StageLabel Name="Scene position #0" X="0.0" XUnit="m" Y="0.0" YUnit="m" Z="0.0" ZUnit="µm"/>
      <Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.16524863660050362" PhysicalSizeXUnit="µm" PhysicalSizeY="0.16524863660050362" PhysicalSizeYUnit="µm" PhysicalSizeZ="0.5318772505477498" PhysicalSizeZUnit="µm" SignificantBits="16" SizeC="2" SizeT="240" SizeX="1800" SizeY="1300" SizeZ="1" Type="uint16">
[...]

Sorry for the late reply

erickmartins commented 1 month ago

PR #91 should deal with that - can you either test that or host the problematic CZI file somewhere I can test it?

technics3 commented 1 month ago

It is working fine !

Here is a link to the dataset the i used (expiring 12/10/2024) : https://filesender.renater.fr/?s=download&token=dd096ce7-4f49-4c37-a23e-620e1106842f

Thanks

erickmartins commented 1 month ago

yeah, I can confirm the new version works. I'll merge the PR and it will be on the next cli-transfer release. Thanks for the report!