<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
Hi Taylor,
<div><br>
</div>
<div>sorry to hear about your issues and thanks for reporting it. I was able to</div>
<div>reproduce the behavior you described using your code example. Setting <span>debugOn to True reveals that the default sitk.Show() command is opening the image ImageJ/Fiji using the MetaImage file format (.mha) which is not supported by Bio-Formats.</span></div>
<div><span><br>
</span></div>
<div><span>Using the SITK_SHOW_EXTENSION environmement variable, you should be able to modify the  intermediate file format  to use NIFTI. Locally, the following code  opens the image in Fiji through the Bio-Formats plugin with the correct scaling/pixel size
 information.</span><br>
<div class="AppleOriginalContents" style="direction:ltr"><br>
</div>
<div class="AppleOriginalContents" style="direction:ltr"><span class="gmail-pl-k" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(215,58,73)">import</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">
 SimpleITK </span><span class="gmail-pl-k" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(215,58,73)">as</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">
 sitk</span></div>
<div class="AppleOriginalContents" style="direction:ltr"><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)"><span class="gmail-pl-k" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(215,58,73)">import</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)"></span>
 os <br>
</span></div>
<div class="AppleOriginalContents" style="direction:ltr"><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)"><span>os.environ['SITK_SHOW_EXTENSION']='.nii'</span></span><br>
<span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">image
</span><span class="gmail-pl-k" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(215,58,73)">=</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">
 sitk.Image(</span><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(0,92,197)">64</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">,
</span><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(0,92,197)">64</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">,
 sitk.sitkFloat32)</span><br>
<span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">image.SetSpacing((</span><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(0,92,197)">2.0</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">,
</span><span class="gmail-pl-c1" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(0,92,197)">3.0</span><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">))</span></div>
<div class="AppleOriginalContents" style="direction:ltr"><span style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(36,41,46)">sitk.Show(image, debugOn=True)</span><span class="gmail-pl-c" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; background-color:rgb(246,248,250); color:rgb(106,115,125)"></span></div>
<div class="AppleOriginalContents" style="direction:ltr"><br>
</div>
<div class="AppleOriginalContents" style="direction:ltr">Best,</div>
<div class="AppleOriginalContents" style="direction:ltr">Sebastien<font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace" color="#6a737d"><span style="font-size:11.899999618530273px; background-color:rgb(246,248,250)"><br>
</span></font>
<blockquote type="cite">On 25 May 2018, at 15:36, Taylor Braun-Jones <taylor@braun-jones.org> wrote:
<br class="Apple-interchange-newline">
<div>
<div dir="ltr" class="">When launching a Fiji with a NIFTI image, the spacing information is ignored. For example using SimpleITK:
<div class=""><br class="">
</div>
<div class="">
<div class="gmail-highlight gmail-highlight-source-python" style="margin-bottom:16px; background-color:rgb(255,255,255); color:rgb(36,41,46); font-size:14px; font-style:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; overflow:visible">
<pre class="" style="font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:11.9px; margin-top:0px; margin-bottom:0px; word-wrap:normal; padding:16px; overflow:auto; line-height:1.45; background-color:rgb(246,248,250); border-radius:3px; word-break:normal"><span class="gmail-pl-k" style="color:rgb(215,58,73)">import</span> SimpleITK <span class="gmail-pl-k" style="color:rgb(215,58,73)">as</span> sitk
image <span class="gmail-pl-k" style="color:rgb(215,58,73)">=</span> sitk.Image(<span class="gmail-pl-c1" style="color:rgb(0,92,197)">64</span>, <span class="gmail-pl-c1" style="color:rgb(0,92,197)">64</span>, sitk.sitkFloat32)
image.SetSpacing((<span class="gmail-pl-c1" style="color:rgb(0,92,197)">2.0</span>, <span class="gmail-pl-c1" style="color:rgb(0,92,197)">3.0</span>))
sitk.Show(image) <span class="gmail-pl-c" style="color:rgb(106,115,125)"><span class="gmail-pl-c" style="color:rgb(106,115,125)">#</span> Image shown in ImageJ has unity pixel spacing</span></pre>
</div>
<div class="">According to SimpleITK team[1], the bug exists with Fiji. According to the Fiji team[2], but bug exists with the bio-formats plugin.</div>
<div class=""><br class="">
</div>
<div class="">[1] <a href="https://github.com/SimpleITK/SimpleITK/issues/438" class="OWAAutoLink" id="LPlnk988335" previewremoved="true">
https://github.com/SimpleITK/SimpleITK/issues/438</a>
<div id="LPBorder_GT_15275055535600.6166790772462316" style="margin-bottom:20px; overflow:auto; width:100%; text-indent:0px">
<table id="LPContainer_15275055535530.9139808276110163" style="width:90%; background-color:rgb(255,255,255); overflow:auto; padding-top:20px; padding-bottom:20px; margin-top:20px; border-top:1px dotted rgb(200,200,200); border-bottom:1px dotted rgb(200,200,200)" cellspacing="0">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td id="ImageCell_15275055535550.5398882755345858" colspan="1" style="width:250px; display:table-cell; padding-right:20px">
<div id="LPImageContainer_15275055535550.7657296763770106" style="background-color:rgb(255,255,255); height:250px; margin:auto; display:table; width:250px">
<a id="LPImageAnchor_15275055535550.6325371261163253" href="https://github.com/SimpleITK/SimpleITK/issues/438" target="_blank" style="display:table-cell; text-align:center"><img id="LPThumbnailImageID_15275055535560.5354349670704547" style="display:inline-block; max-width:250px; max-height:250px; height:250px; width:250px; border-width:0px; vertical-align:bottom" width="250" height="250" src="https://avatars1.githubusercontent.com/u/514960?s=400&v=4"></a></div>
</td>
<td id="TextCell_15275055535580.9255216892413461" colspan="2" style="vertical-align: top; padding: 0px; display: table-cell; position: relative;">
<div id="LPRemovePreviewContainer_15275055535580.42987490284462515"></div>
<div id="LPTitle_15275055535580.5988972354982001" style="top:0px; color:rgb(0,120,215); font-weight:400; font-size:21px; font-family:"wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height:21px">
<a id="LPUrlAnchor_15275055535580.14878950484353926" href="https://github.com/SimpleITK/SimpleITK/issues/438" target="_blank" style="text-decoration:none">Show method does not preserve pixel spacing · Issue #438 · SimpleITK/SimpleITK</a></div>
<div id="LPMetadata_15275055535590.4002405718316284" style="margin:10px 0px 16px; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:14px">
github.com</div>
<div id="LPDescription_15275055535600.3420707833812632" style="display:block; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:20px; max-height:100px; overflow:hidden">
My expectation is that with the code below: import SimpleITK as sitk image = sitk.Image(64, 64, sitk.sitkFloat32) image.SetSpacing((2.0, 3.0)) sitk.Show(image) # Image shown in ImageJ has unity pix...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br class="">
</div>
</div>
<div class="">[2] <a href="https://github.com/fiji/fiji/issues/191" class="OWAAutoLink" id="LPlnk197584" previewremoved="true">https://github.com/fiji/fiji/issues/191</a></div>
</div>
_______________________________________________<br class="">
ome-users mailing list<br class="">
ome-users@lists.openmicroscopy.org.uk<br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>