[Rtk-users] hello. just a little question about rtk

Simon Rit simon.rit at creatis.insa-lyon.fr
Wed Mar 18 04:07:44 EDT 2015


Hi,
Please, suscribe to the mailing list to be able to post on it, it is of
course open.
I did not understand the need to go from hnd to pfm to tif since RTK can
handle hnd. Note that vv <http://vv.creatis.insa-lyon.fr/> can open hnd
files.
Then there is a geometry problem, maybe your meta information (origin,
pixel spacing, etc.) is lost in all these conversions.
Simon


On Tue, Mar 17, 2015 at 4:15 PM, bambykaa 1 <bambykaa at yandex.ru> wrote:

> Hello. I haven't access to post to mailing list, that is why i write to
> this address. need a little help =)
> So, I wanna reconstruct something from tifs, let's try reconstruct from
> tifs that taken-converted from rtk wiki RTK/Examples/VarianReconstruction.
> What i do:
> - download files for RTK/Examples/VarianReconstruction
> (ProjectionInfo.xml, Scan0/*.hnd)
>
> - do as shown in example script:
> rtkvarianobigeometry --xml_file ProjectionInfo.xml --path Scan0/ --regexp
> Proj_.*.hnd -o geometry.xml
>  rtkfdk \
>    --geometry geometry.xml \
>    --regexp .*.hnd \
>    --path Scan0 \
>    --output slice30.mha \
>    --verbose \
>    --spacing 0.25,0.25,0.25 \
>    --dimension 1024,1,1024 \
>    --origin -127.875,30,-127.875
> everything is ok, i got slice30.mha which contains 30th slice
>
> - then i convert all hnd files to pfm via hnd_to_pfm (plastimatch)
>
> - then i wrote simple c++ program which opens pfm files via libpfm (
> http://people.cs.kuleuven.be/~ares.lagae/libpfm/) and create tiff files
> via libtiff.
> tiff fields setup as following:
>   TIFFSetField(img, TIFFTAG_IMAGEWIDTH, 1024);
>   TIFFSetField(img, TIFFTAG_XRESOLUTION, 300);
>   TIFFSetField(img, TIFFTAG_YRESOLUTION, 300);
>   TIFFSetField(img, TIFFTAG_BITSPERSAMPLE, 8);
>   TIFFSetField(img, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
> 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
> http://www.itk.org/ItkSoftwareGuide.pdf page 42,   0.25 is the pixel
> size, but what values ? um ? um * 100 ? or i totally misundestand ? ;)  )
> or just something operate with
> <DetectorSizeX>397.312</DetectorSizeX>
>     <DetectorSizeY>297.984</DetectorSizeY>
> from ProjectionInfo.xml ?
>
> okay, i created 8bit tifs, with simple convertion:
>     char line[width];
>     for (std::size_t row = 0; row < height; ++row)
>     {
>       pfm_input_file.read_grayscale_scanline(&scanline[0], width);
>       for (int i = 0; i < width; i++)
>               line[i] = scanline[i] * 255;
>       TIFFWriteScanline(img, line, row);
>    }
>
> here is the result for one projection http://i.imgur.com/YXvyjq1.png.
> unfortunately i can't find any viewer that could show me hnd file.. i can't
> check is my convertion correct..
>
> - 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. :
>  rtkfdk \
>    --geometry geometry.xml \
>    --regexp .*.tif \
>    --path Scan0 \
>    --output slice30.mha \
>    --verbose \
>    --spacing 0.25,0.25,0.25 \
>    --dimension 1024,1,1024 \
>    --origin -127.875,30,-127.875
>
> and i got :
> Regular expression matches 686 file(s)...
> Reading... It took 4.52642 s
> Reading geometry information from geometry.xml...
> Reconstructing and writing... ExceptionObject caught with writer->Update()
> in file /home/koza/src/RTK/applications/rtkfdk/rtkfdk.cxx line 232
> itk::ExceptionObject (0x19fb420)
> Location: "unknown"
> File:
> /home/koza/src/RTK/code/rtkDisplacedDetectorForOffsetFieldOfViewImageFilter.txx
> Line: 79
> Description: itk::ERROR: Cannot account for too large detector
> displacements, a part of space must be covered by all projections.
>
> i have no idea what is wrong, any help would appreciated. sry for long
> post.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20150318/f1aab64b/attachment-0008.html>


More information about the Rtk-users mailing list