<div dir="ltr"><div><div><div><div>Hi,<br>Please, suscribe to the mailing list to be able to post on it, it is of course open.<br></div>I did not understand the need to go from hnd to pfm to tif since RTK can handle hnd. Note that <a href="http://vv.creatis.insa-lyon.fr/">vv</a> can open hnd files.<br></div>Then there is a geometry problem, maybe your meta information (origin, pixel spacing, etc.) is lost in all these conversions.<br></div></div>Simon <br><div><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 4:15 PM, bambykaa 1 <span dir="ltr"><<a href="mailto:bambykaa@yandex.ru" target="_blank">bambykaa@yandex.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello. I haven't access to post to mailing list, that is why i write to this address. need a little help =)<br>
So, I wanna reconstruct something from tifs, let's try reconstruct from tifs that taken-converted from rtk wiki RTK/Examples/VarianReconstruction.<br>
What i do:<br>
- download files for RTK/Examples/VarianReconstruction (ProjectionInfo.xml, Scan0/*.hnd)<br>
<br>
- do as shown in example script:<br>
rtkvarianobigeometry --xml_file ProjectionInfo.xml --path Scan0/ --regexp Proj_.*.hnd -o geometry.xml<br>
 rtkfdk \<br>
   --geometry geometry.xml \<br>
   --regexp .*.hnd \<br>
   --path Scan0 \<br>
   --output slice30.mha \<br>
   --verbose \<br>
   --spacing 0.25,0.25,0.25 \<br>
   --dimension 1024,1,1024 \<br>
   --origin -127.875,30,-127.875<br>
everything is ok, i got slice30.mha which contains 30th slice<br>
<br>
- then i convert all hnd files to pfm via hnd_to_pfm (plastimatch)<br>
<br>
- then i wrote simple c++ program which opens pfm files via libpfm (<a href="http://people.cs.kuleuven.be/~ares.lagae/libpfm/" target="_blank">http://people.cs.kuleuven.be/~ares.lagae/libpfm/</a>) and create tiff files via libtiff.<br>
tiff fields setup as following:<br>
  TIFFSetField(img, TIFFTAG_IMAGEWIDTH, 1024);<br>
  TIFFSetField(img, TIFFTAG_XRESOLUTION, 300);<br>
  TIFFSetField(img, TIFFTAG_YRESOLUTION, 300);<br>
  TIFFSetField(img, TIFFTAG_BITSPERSAMPLE, 8);<br>
  TIFFSetField(img, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);<br>
i set fake dpi... is it critical ? i dont know how calculate dpi, may be just 254000/spacing i.e. 254000/25 ?  (as i undestand by reading <a href="http://www.itk.org/ItkSoftwareGuide.pdf" target="_blank">http://www.itk.org/ItkSoftwareGuide.pdf</a> page 42,   0.25 is the pixel size, but what values ? um ? um * 100 ? or i totally misundestand ? ;)  )<br>
or just something operate with<br>
<DetectorSizeX>397.312</DetectorSizeX><br>
    <DetectorSizeY>297.984</DetectorSizeY><br>
from ProjectionInfo.xml ?<br>
<br>
okay, i created 8bit tifs, with simple convertion:<br>
    char line[width];<br>
    for (std::size_t row = 0; row < height; ++row)<br>
    {<br>
      pfm_input_file.read_grayscale_scanline(&scanline[0], width);<br>
      for (int i = 0; i < width; i++)<br>
              line[i] = scanline[i] * 255;<br>
      TIFFWriteScanline(img, line, row);<br>
   }<br>
<br>
here is the result for one projection <a href="http://i.imgur.com/YXvyjq1.png" target="_blank">http://i.imgur.com/YXvyjq1.png</a>. unfortunately i can't find any viewer that could show me hnd file.. i can't check is my convertion correct..<br>
<br>
- here is the step where the dark times came to me =) i run the same reconstruct command except specifiying files *.tif instead *.hnd. i.e. :<br>
 rtkfdk \<br>
   --geometry geometry.xml \<br>
   --regexp .*.tif \<br>
   --path Scan0 \<br>
   --output slice30.mha \<br>
   --verbose \<br>
   --spacing 0.25,0.25,0.25 \<br>
   --dimension 1024,1,1024 \<br>
   --origin -127.875,30,-127.875<br>
<br>
and i got :<br>
Regular expression matches 686 file(s)...<br>
Reading... It took 4.52642 s<br>
Reading geometry information from geometry.xml...<br>
Reconstructing and writing... ExceptionObject caught with writer->Update() in file /home/koza/src/RTK/applications/rtkfdk/rtkfdk.cxx line 232<br>
itk::ExceptionObject (0x19fb420)<br>
Location: "unknown"<br>
File: /home/koza/src/RTK/code/rtkDisplacedDetectorForOffsetFieldOfViewImageFilter.txx<br>
Line: 79<br>
Description: itk::ERROR: Cannot account for too large detector displacements, a part of space must be covered by all projections.<br>
<br>
i have no idea what is wrong, any help would appreciated. sry for long post.<br>
</blockquote></div><br></div></div></div></div></div></div>