<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Tom Goddard <<a href="mailto:goddard@sonic.net" class="">goddard@sonic.net</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">Re: [chimerax-users] EMDB-SFF segmentation file: application of transform 0 for image-to-physical projection</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">January 30, 2023 at 11:54:02 AM PST<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Paul Korir<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Cc: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""> Martin Schorb<br class=""></span></div><br class=""><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Paul,<div class=""><br class=""></div><div class=""> ChimeraX does not specify what distance units the open models use. For atomic structures and cryoEM map it is usually Angstroms. For light microscopy images it is often microns. For medical image scans (MRI, CAT) it is I think meters. The file formats for the data define the physical distance units, not ChimeraX. So if EMDB SFF provides a segmentation for say an MRC or CCP4 density map file the scaling of that density map in the ChimeraX graphics is taken from the file header which has a field "cell dimensions in Angstroms". If a segmentation of that density map is made that is say a bounding surface it might use x,y,z coordinates in Angstroms or it might use grid index units when it writes out a file, that would depend on the segmentation file format and the software that is writing the segmentation. In ChimeraX it always tries to scale the data into physical units so that different data sets, like an atomic structure and 3D image data have the correct relative scale. So ChimeraX never displays images using grid index units.</div><div class=""><br class=""></div><div class=""> So from what you say about EMDB SFF the first transform goes from grid index units to physical units and ChimeraX should apply that transformation to the segmentation data so that it has the same scaling as the map data that the segmentation was derived from. I see there is a function in the ChimeraX EMDB SFF file reader called "guess_scale_and_shift" that is trying to figure out what transform to apply, but it is just a hack and looks for any non-identity transform.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://github.com/RBVI/ChimeraX/blob/da72f2cd9b23c0c35a66122b7edc453d593ea3e3/src/bundles/emdb_sff/src/sff.py#L125" class="">https://github.com/RBVI/ChimeraX/blob/da72f2cd9b23c0c35a66122b7edc453d593ea3e3/src/bundles/emdb_sff/src/sff.py#L125</a></div><div class=""><br class=""></div><div class="">And another comment in the code suggests it is doing that hack because it was needed for EMDB SFF test data EMDB 1547.</div><div class=""><br class=""></div><div class=""> If I understand you correctly ChimeraX should instead always apply the first transform from transforms_list. I can make that change. The main thing will be to test it on pairs of EMDB SFF segmentations and corresponding maps to make sure it produces the correct alignment.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Tom</div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 30, 2023, at 2:20 AM, Paul Korir via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div class=""><p class="">Hi Tom/ChimeraX admin,<br class="">
</p><p class="">Just to clarify: what are the units of physical space in
ChimeraX: Å or nm? <br class="">
</p><p class="">Kind regards,<br class="">
</p>
<div class="moz-signature"><p style="font-size: 10pt" class="">
<strong class="">Paul K. Korir, PhD</strong><br class="">
<em class="">3D Visualisation Lead</em><br class="">
<span style="color: grey" class="">CS3DB</span><br class="">
<span style="color: grey" class=""><strong class="">EMBL-EBI</strong></span><br class="">
</p>
</div>
<div class="moz-cite-prefix">On 30/01/2023 08:51, Paul Korir wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:27e40698-aa49-468a-17d4-bc93a780f2c3@ebi.ac.uk" class="">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" class=""><p class="">Hi Tom,</p><p class="">To the best of my understanding, ChimeraX displays images and
associated segmentations in physical space not image space.
However, segmentations are performed in image space. EMDB-SFF
uses the first transform in the transforms_list field (with
id=0) as the image-to-physical transform.
(<a class="moz-txt-link-freetext" href="https://emdb-empiar.github.io/EMDB-SFF/v0.8.0.dev1/segmentation_da_xsd.html#segmentation_transform_list" moz-do-not-send="true">https://emdb-empiar.github.io/EMDB-SFF/v0.8.0.dev1/segmentation_da_xsd.html#segmentation_transform_list</a>)</p><p class="">I've tested with two files having the same segmentation but
different values for transform 0 and they render the same.</p><p class="">Could you please implement this feature in ChimeraX?</p><p class="">Kind regards,<br class="">
</p>
<div class="moz-signature">-- <br class=""><p style="font-size: 10pt" class=""> <strong class="">Paul K. Korir, PhD</strong><br class="">
<em class="">3D Visualisation Lead</em><br class="">
<span style="color: grey" class="">CS3DB</span><br class="">
<span style="color: grey" class=""><strong class="">EMBL-EBI</strong></span><br class="">
</p>
</div>
</blockquote>
</div>
</div>_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>