From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Thu May 2 03:29:28 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Thu, 02 May 2013 09:29:28 +0200 Subject: [Rtk-users] .dat to .mha image Message-ID: <518215D8.3010501@mail.medecom.fr> Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura From Cyril.Mory at philips.com Thu May 2 04:51:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 2 May 2013 08:51:06 +0000 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <518215D8.3010501@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Hi Laura, In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw You can create the .mhd header yourself, using a text editor. Here is an example : ObjectType = Image NDims = 2 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 1 Offset = -190.5 -190.5 CenterOfRotation = 0 0 ElementSpacing = 3 3 DimSize = 128 128 ElementType = MET_FLOAT ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : #!/bin/bash # Concatenate all projections into a single raw file NbProj=300 i=0 list="projection${i}.raw" for i in $(seq 1 1 $(($NbProj-1))) do list="$list projection${i}.raw" done cat $list > SheppLogan.raw which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" -----Message d'origine----- De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil Envoy? : jeudi 2 mai 2013 09:29 ? : rtk-users at openrtk.org Objet : [Rtk-users] .dat to .mha image Dear RTK users, I am working on GATE (from Geant4), to create projections images of tomosynthesis. I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). I want to reconstruct a 3D volume, from projections, with RTK. To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. I anyone could help... Regards, Laura _______________________________________________ Rtk-users mailing list Rtk-users at openrtk.org http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From simon.rit at creatis.insa-lyon.fr Sun May 5 05:20:22 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 5 May 2013 11:20:22 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> Message-ID: Dear Laura, I think that in the latest version of Gate, you should be able to write mhd files. hdr file format should also work in both platforms. What happens if you change the extension of your output files to .mhd? Regards, Simon On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL wrote: > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats (or whatever) representing the pixel intensities, and the .mhd a simple header that indicates the number of dimensions, the size in pixels along each dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is an example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you manage to visualize a single projection (there are plenty of viewers that open mhd/raw files), and then create a header for the whole sequence (NDims = 3, etc ...) and concatenate the .dat binary files into a single one. You could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of float numbers that stores the simulated tomosynthesis image and is produced for each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example to .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From menjiawan at gmail.com Thu May 9 12:05:52 2013 From: menjiawan at gmail.com (Wang,Mengjiao) Date: Thu, 09 May 2013 12:05:52 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction Message-ID: <518BC960.4000009@gmail.com> Hey, all. I am encountering with the truncation artifact in CBCT reconstruction. Does our RTK group have solution for this situation? Thanks. Mengjiao From simon.rit at creatis.insa-lyon.fr Sat May 11 20:12:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 12 May 2013 02:12:33 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: <518BC960.4000009@gmail.com> References: <518BC960.4000009@gmail.com> Message-ID: Hi Mengjiao, Yes we do. The simplest solution is described in a paper by Ohnesorge, Med Phys, 2000. It consists in padding your projection images with data to smooth the transition to 0. If you use the command line executable, you have to do something like: rtkfdk --pad 1 The parameter will set the amount of padding. 0 means no padding, 0.5 means pad with 50% more data than normally and the max value is 1, i.e., 100% padding. If you use the code, you have to do something like r->GetRampFilter()->SetTruncationCorrection(1.); where r is an object of type rtk::FDKConeBeamReconstructionFilter. We don't have the Noo algorithm implemented yet (two steps, differentiated backprojection) but we have a project to work on this next year. Simon On Thu, May 9, 2013 at 6:05 PM, Wang,Mengjiao wrote: > Hey, all. > > I am encountering with the truncation artifact in CBCT reconstruction. Does > our RTK group have solution for this situation? > > Thanks. > > Mengjiao > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users From taylor at braun-jones.org Sun May 12 12:50:54 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Sun, 12 May 2013 12:50:54 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: On Sat, May 11, 2013 at 8:12 PM, Simon Rit wrote: > We don't have the Noo algorithm implemented yet (two steps, > differentiated backprojection) but we have a project to work on this > next year. > Do you have a link/reference for the Noo algorithm you are referring to? I'm not aware of it. Thanks, Taylor -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 04:18:07 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 10:18:07 +0200 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: There are many, it has been one of the big topics in tomography for the past ten years. The first one I have is Noo, F.; Clackdoyle, R. & Pack, J. A two-step Hilbert transform method for 2D image reconstruction Phys Med Biol, 2004, 49, 3903-3923 Note that there have been other algorithms proposed to cope with truncated projections. There is a review here: Clackdoyle, R. & Defrise, M. Tomographic Reconstruction in the 21st Century IEEE Signal Proc. Mag., 2010, 27, 60-80 On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones wrote: > On Sat, May 11, 2013 at 8:12 PM, Simon Rit > wrote: >> >> We don't have the Noo algorithm implemented yet (two steps, >> differentiated backprojection) but we have a project to work on this >> next year. > > > Do you have a link/reference for the Noo algorithm you are referring to? I'm > not aware of it. > > Thanks, > Taylor From taylor at braun-jones.org Mon May 13 09:11:12 2013 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Mon, 13 May 2013 09:11:12 -0400 Subject: [Rtk-users] Truncation artifact in CBCT reconstruction In-Reply-To: References: <518BC960.4000009@gmail.com> Message-ID: Thanks! On Mon, May 13, 2013 at 4:18 AM, Simon Rit wrote: > There are many, it has been one of the big topics in tomography for > the past ten years. The first one I have is > Noo, F.; Clackdoyle, R. & Pack, J. > A two-step Hilbert transform method for 2D image reconstruction > Phys Med Biol, 2004, 49, 3903-3923 > Note that there have been other algorithms proposed to cope with > truncated projections. There is a review here: > Clackdoyle, R. & Defrise, M. > Tomographic Reconstruction in the 21st Century > IEEE Signal Proc. Mag., 2010, 27, 60-80 > > On Sun, May 12, 2013 at 6:50 PM, Taylor Braun-Jones > wrote: > > On Sat, May 11, 2013 at 8:12 PM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> > > wrote: > >> > >> We don't have the Noo algorithm implemented yet (two steps, > >> differentiated backprojection) but we have a project to work on this > >> next year. > > > > > > Do you have a link/reference for the Noo algorithm you are referring to? > I'm > > not aware of it. > > > > Thanks, > > Taylor > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 13 10:14:35 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 13 May 2013 16:14:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <5188B5CB.4080508@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: Dear Laura, If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting by the angular gap (angular distance between the previous and the next projection) so that will be a problem. If you only use the backprojection, that should not be a problem. With FDK, there are a few solutions, the simplest being to trick the algorithm by adding 2 projections with zeros at the beginning and the end of your tomosynthesis acquisition. If you have some problems with the geometry, don't hesitate to provide your Gate macros and we can try to help. Simon On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>> > > From hsieandy at gmail.com Wed May 15 02:15:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Wed, 15 May 2013 16:15:13 +1000 Subject: [Rtk-users] Angular gaps Message-ID: Hi Simon, First of all, I regret not being able to going to ICCR, otherwise I could really thank you for your work in RTK. It has really helped me a lot in my research! Fortunately a few of my colleagues got a chance to talk to you (Ricky and John, if you remember). Hopefully I'll see you this year in AAPM!! So today I want to ask you about two things. 1. Failed reconstruction (due to maximum angular gap too big?) I noticed that occasionally RTK gives reconstruction that looks like this. [image: ???? 1] In case the picture is not sent through, the image has a big angular region where the intensity is essentially zero when viewed axially. This happens when I use displacement binning, and using half-fan data. I summarized all my reconstructions and realize this only happens when the "maximum angular gap" of the projections in that bin is greater than 20 degrees. Therefore I assume it's because the half-fan projection on one side not being able to find its corresponding projection image on the other side. I just want to check with you if that's what's happening here. 2. There is a paper on direct weighting of uneven angular spaced projections. http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 I think the idea is basically lower the weight of closely spaced projections. Is this already implemented in RTK? Thanks Simon !! :) Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 15 08:34:44 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 15 May 2013 14:34:44 +0200 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: Hi Andy, Unfortunately I'm not going to the AAPM so we'll have to continue communicating by email. Let us know if there are developments that would be of interest for RTK. Regarding your questions: 1. you can not have both a short scan and a displaced detector, otherwise you have missing data. The consequence of missing data is probably what you observe here. We could add a check to inform the user but there is essentially not enough information to reconstruct this. 2. We do weight the projections by uneven angles in the FDK algorithms. This is done during the 2D weighting. Follow the variable m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx I hope this helps. Cheers, Simon On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > Hi Simon, > > First of all, I regret not being able to going to ICCR, otherwise I could > really thank you for your work in RTK. It has really helped me a lot in my > research! Fortunately a few of my colleagues got a chance to talk to you > (Ricky and John, if you remember). Hopefully I'll see you this year in > AAPM!! > > So today I want to ask you about two things. > > 1. Failed reconstruction (due to maximum angular gap too big?) > I noticed that occasionally RTK gives reconstruction that looks like this. > [image: ???? 1] > In case the picture is not sent through, the image has a big angular > region where the intensity is essentially zero when viewed axially. This > happens when I use displacement binning, and using half-fan data. > I summarized all my reconstructions and realize this only happens when the > "maximum angular gap" of the projections in that bin is greater than 20 > degrees. Therefore I assume it's because the half-fan projection on one > side not being able to find its corresponding projection image on the other > side. I just want to check with you if that's what's happening here. > > 2. There is a paper on direct weighting of uneven angular spaced > projections. > http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 > I think the idea is basically lower the weight of closely spaced > projections. > Is this already implemented in RTK? > > Thanks Simon !! :) > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From hsieandy at gmail.com Fri May 17 01:39:13 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Fri, 17 May 2013 15:39:13 +1000 Subject: [Rtk-users] Angular gaps In-Reply-To: References: Message-ID: 1. OK thank you! That makes sense. 2. Yes that did help a lot! Thank you! Andy 2013/5/15 Simon Rit > Hi Andy, > Unfortunately I'm not going to the AAPM so we'll have to continue > communicating by email. Let us know if there are developments that would be > of interest for RTK. > Regarding your questions: > 1. you can not have both a short scan and a displaced detector, otherwise > you have missing data. The consequence of missing data is probably what you > observe here. We could add a check to inform the user but there is > essentially not enough information to reconstruct this. > 2. We do weight the projections by uneven angles in the FDK algorithms. > This is done during the 2D weighting. Follow the variable > m_AngularWeightsAndRampFactor in rtkFDKWeightProjectionFilter.txx: > > https://github.com/SimonRit/RTK/blob/master/code/rtkFDKWeightProjectionFilter.txx > I hope this helps. Cheers, > Simon > > > On Wed, May 15, 2013 at 8:15 AM, Andy Shieh wrote: > >> Hi Simon, >> >> First of all, I regret not being able to going to ICCR, otherwise I could >> really thank you for your work in RTK. It has really helped me a lot in my >> research! Fortunately a few of my colleagues got a chance to talk to you >> (Ricky and John, if you remember). Hopefully I'll see you this year in >> AAPM!! >> >> So today I want to ask you about two things. >> >> 1. Failed reconstruction (due to maximum angular gap too big?) >> I noticed that occasionally RTK gives reconstruction that looks like this. >> [image: ???? 1] >> In case the picture is not sent through, the image has a big angular >> region where the intensity is essentially zero when viewed axially. This >> happens when I use displacement binning, and using half-fan data. >> I summarized all my reconstructions and realize this only happens when >> the "maximum angular gap" of the projections in that bin is greater than 20 >> degrees. Therefore I assume it's because the half-fan projection on one >> side not being able to find its corresponding projection image on the other >> side. I just want to check with you if that's what's happening here. >> >> 2. There is a paper on direct weighting of uneven angular spaced >> projections. >> http://link.springer.com/chapter/10.1007%2F978-3-642-33415-3_23 >> I think the idea is basically lower the weight of closely spaced >> projections. >> Is this already implemented in RTK? >> >> Thanks Simon !! :) >> >> Cheers, >> Andy >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 53548 bytes Desc: not available URL: From Cyril.Mory at philips.com Fri May 24 05:44:55 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 24 May 2013 09:44:55 +0000 Subject: [Rtk-users] CUDA 3D texture memory management Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi everyone, I'm converting a filter I've designed into CUDA, and I'm new to CUDA. The filter takes in input a 4d image (3D +time), interpolates between two instants (two 3D images taken from the 4D image by selecting a given instant) to obtain a 3D image, and forward projects through this 3D image. I already have an interpolation kernel that works, it uses global memory to store both the 4D image and the interpolated 3D image (there probably is a better way, but I'll optimize that later). For the forward projection, I'd like to reuse as much as possible the rtkCudaForwardProjectionImageFilter code, but : - rtkCudaForwardProjectionImageFilter stores its input 3D volume into a 3D texture - texture memory, I think, is read-only for threads - So I can't fill in the 3D texture during interpolation I think I need to work with global memory during interpolation to generate the 3D volume, then somehow copy the result to a 3D texture, and use the existing (maybe slightly modified) forward projection function to get the projection. My problem is in the "somehow"... Do I need to actually copy the data from the global memory to the texture memory ? Or is it enough to bind it to a texture ? Does anyone have an example somewhere ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 24 07:17:40 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 24 May 2013 13:17:40 +0200 Subject: [Rtk-users] CUDA 3D texture memory management In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F9796C@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, We haven't done any example like this in RTK but my guess is that: - at the beginning, you malloc your memory with cudaMalloc3DArray. I believe this is standard (but aligned appropriately) global memory - when you need the texture (for interpolation), you do cudaBindTextureToArray run the kernel cudaUnbindTexture - when you need to write in the memory, you can use the pointer provided by cudaMalloc3DArray as any global memory pointer. Let us know if this does not work, Simon On Fri, May 24, 2013 at 11:44 AM, MORY, CYRIL wrote: > Hi everyone, > > > > I?m converting a filter I?ve designed into CUDA, and I?m new to CUDA. The > filter takes in input a 4d image (3D +time), interpolates between two > instants (two 3D images taken from the 4D image by selecting a given > instant) to obtain a 3D image, and forward projects through this 3D image. I > already have an interpolation kernel that works, it uses global memory to > store both the 4D image and the interpolated 3D image (there probably is a > better way, but I?ll optimize that later). For the forward projection, I?d > like to reuse as much as possible the rtkCudaForwardProjectionImageFilter > code, but : > > - rtkCudaForwardProjectionImageFilter stores its input 3D volume > into a 3D texture > > - texture memory, I think, is read-only for threads > > - So I can?t fill in the 3D texture during interpolation > > I think I need to work with global memory during interpolation to generate > the 3D volume, then somehow copy the result to a 3D texture, and use the > existing (maybe slightly modified) forward projection function to get the > projection. > > > > My problem is in the ?somehow?? Do I need to actually copy the data from the > global memory to the texture memory ? Or is it enough to bind it to a > texture ? Does anyone have an example somewhere ? > > > > Regards, > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Mon May 27 09:44:41 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Mon, 27 May 2013 15:44:41 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> Message-ID: <51A36349.1030804@mail.medecom.fr> Dear RTK-users, I am working on reconstruction with RTK backprojection algorithm. RTK Wiki examples worked fine but now, I am trying with my own images, and I obtain a result I cannot explain. I have 15 projections, simulated with GATE. My phantom is a water cylinder, containing 4 balls of different materials. I attached one of them with the mail, to give an example (the other are quite similar, only the place of the balls changes). I generate a geometry.xml file with the command**: *rtksimulatedgeometry -o geometry.xml -n 15 --sdd 300 --sid 150* and then apply rtkbackprojection with : *rtkbackprojections -o output.mha -g geometry.xml **-r header.mhd -p.* I display output.mha with VTK and obtain a white cube... Does anybody have an idea of what I am missing? Is the number of projections too small? Is it a display problem? Regards, Laura Trubuil Le 13/05/2013 16:14, Simon Rit a ?crit : > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De :rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? :rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: benchmarkCT_000.dat Type: application/octet-stream Size: 40000 bytes Desc: not available URL: -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = LIST benchmarkCT_000.dat benchmarkCT_001.dat benchmarkCT_002.dat benchmarkCT_003.dat benchmarkCT_004.dat benchmarkCT_005.dat benchmarkCT_006.dat benchmarkCT_007.dat benchmarkCT_008.dat benchmarkCT_009.dat benchmarkCT_010.dat benchmarkCT_011.dat benchmarkCT_012.dat benchmarkCT_013.dat benchmarkCT_014.dat -------------- next part -------------- ObjectType=Image NDims = 2 DimSize = 100 100 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False ElementType = MET_FLOAT ElementDataFile = benchmarkCT_000.dat From Cyril.Mory at philips.com Tue May 28 10:24:43 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Tue, 28 May 2013 14:24:43 +0000 Subject: [Rtk-users] RTK and CUDA Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I have a few questions regarding CUDA in RTK : - In rtkCudaForwardProjectImageFilter.cu, which I'm using as a starting point, suppose I want to set to zero all elements of the 3D array allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would do it ? I've been unable to make it using CudaMemset3D(), which seems to work only when memory has been allocated with CudaMalloc3D(), not with CudaMalloc3DArray(). - I get a "CUDA ERROR : Unknown error" in the execution of the line "cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );" in my program. I really do not have a clue why. I'd like to use the cuda debugger to understand what I'm doing wrong. Is it possible via CMake ? How should I modify the CMake files to do so ? Regards, ========================================== Cyril Mory PhD student at Philips Medisys and CREATIS Groupement Hospitalier Est H?pital Cardiologique Louis Pradel Laboratoire CREATIS - B?t. B13 CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 28, Avenue du Doyen LEPINE 69677 Bron cedex FRANCE Office : +33 4 72 35 74 12 Cell : +33 6 69 46 73 79 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 28 14:05:33 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:05:33 +0200 Subject: [Rtk-users] RTK and CUDA In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F97D3E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi, On Tue, May 28, 2013 at 4:24 PM, MORY, CYRIL wrote: > Hi, > > > > I have a few questions regarding CUDA in RTK : > > - In rtkCudaForwardProjectImageFilter.cu, which I?m using as a > starting point, suppose I want to set to zero all elements of the 3D array > allocated by cudaMalloc3DArray(). Do you know of a Cuda function that would > do it ? I?ve been unable to make it using CudaMemset3D(), which seems to > work only when memory has been allocated with CudaMalloc3D(), not with > CudaMalloc3DArray(). cudaMemset should do the job I believe. Have you given it a try? > > - I get a ?CUDA ERROR : Unknown error? in the execution of the line > ?cudaBindTexture (0, tex_matrix, dev_matrix, 12*sizeof(float) );? in my > program. I really do not have a clue why. I?d like to use the cuda debugger > to understand what I?m doing wrong. Is it possible via CMake ? How should I > modify the CMake files to do so ? I have no idea, debugging has always been a pain in cuda. I tend to rely on good old printf outside kernel. In the kernel, you must use cuprintf. My feeling is that debugging should be straightforward outside the kernel but have you tried to simply compile rtk in debug mode+cuda? > > > > Regards, > > > > ========================================== > > Cyril Mory > > PhD student at Philips Medisys and CREATIS > > > > Groupement Hospitalier Est > > H?pital Cardiologique Louis Pradel > > Laboratoire CREATIS - B?t. B13 > > CNRS UMR5220, INSERM U1044, INSA-Lyon, Univ. Lyon 1 > > 28, Avenue du Doyen LEPINE > > 69677 Bron cedex FRANCE > > > > Office : +33 4 72 35 74 12 > > Cell : +33 6 69 46 73 79 > > > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From simon.rit at creatis.insa-lyon.fr Tue May 28 14:30:13 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 28 May 2013 20:30:13 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A36349.1030804@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: Hi Laura, I think you are missing a point in the geometry definition. By default, it assumes that the ray going through the source and the isocenter (point of coordinate 0 0 0 in the volume) is intersecting the projection at coordinate (0 0). In the projection that you have sent, (0 0) is the corner of your image. Two solutions : - run the geometry specifying the translation rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 --proj_iso_x -50 --proj_iso_y -50 rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml - Change the origin of your image in your mhd file by adding the following line Offset = -50 -50 Simon On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil wrote: > Dear RTK-users, > > I am working on reconstruction with RTK backprojection algorithm. > RTK Wiki examples worked fine but now, I am trying with my own images, and I > obtain a result I cannot explain. > > I have 15 projections, simulated with GATE. My phantom is a water cylinder, > containing 4 balls of different materials. > I attached one of them with the mail, to give an example (the other are > quite similar, only the place of the balls changes). > > I generate a geometry.xml file with the command : rtksimulatedgeometry -o > geometry.xml -n 15 --sdd 300 --sid 150 > and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g > geometry.xml -r header.mhd -p. > I display output.mha with VTK and obtain a white cube... > > Does anybody have an idea of what I am missing? Is the number of projections > too small? Is it a display problem? > > Regards, > > Laura Trubuil > > > > Le 13/05/2013 16:14, Simon Rit a ?crit : > > Dear Laura, > If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting > by the angular gap (angular distance between the previous and the next > projection) so that will be a problem. If you only use the > backprojection, that should not be a problem. > With FDK, there are a few solutions, the simplest being to trick the > algorithm by adding 2 projections with zeros at the beginning and the > end of your tomosynthesis acquisition. > If you have some problems with the geometry, don't hesitate to provide > your Gate macros and we can try to help. > Simon > > On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil > wrote: > > Dear Simon, > Thank you for your help. > > It is a circular cone beam CT, yes. > In fact, what I precisely do is working on tomosynthesis. I use the CT > scanner simulator of GATE as a basis for a tomosynthesis simulation. The > only differences are that the X-Ray dose is lower, and the angle is not 360? > but 40? maximum. I do not think it is a problem for RTK, is it? > First, I intend to use RTK backprojection, and then, I will try to enhance > the quality of the reconstruction by filtering techniques. > > I have already done some simulations on GATE, for small animal in a first > time (because the computation time is too long for real human chest > detectors, which are much bigger). It allows me to work on algorithms and > test reconstruction with something, for the moment! I will be glad to help > you if I can. > > I will continue studying RTK examples, I will let you know if I make some > progress. Thanks again. > > Regards, > > Laura > > > Le 07/05/2013 01:50, Simon Rit a ?crit : > > Hi, > I don't know the CT simulation module of Gate so I can't help you. I > will discuss this matter with my colleagues. We are currently working > on a new CT simulation module but we definitely need to investigate > how one can reconstruct from the existing module. What is the geometry > of the scanner, is it circular cone-beam CT? It is the only geometry > that RTK can handle. > To understand how to use mhd files, you can look at other examples on > RTK wiki. We will work on your problem and I'll let you know as soon > as we have progressed but keep us informed if you make some progresses > on your side. > Regards, > Simon > > On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil > wrote: > > Dear Simon, > > Thank you for your answer. > I am using the CT Scanner simulation in GATE, so the output available > are > the ".root" and the ".dat" only. > > First, I simply tried to change the extension ".dat" to ".mhd" or to > ".raw" > but, as expected, it does not work because I need to specifiy which kind > of > data the file contains (the role of the header in fact...). > Then, I tried to do something with the GateToImage Class, which contains > a > function called WriteMHD, but it was not a success... I did not find a > way > to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is > when I decided to ask the RTK users! > > With M. Mory's method, I am now able to open my ".dat" files with > ImageFileReader function from ITK, and visualize it with VTK. > > > For the moment, I am trying to reconstruct slices from 15 projections > acquired with the CT Scanner example in GATE. > Have you got any example of reconstruction of slices from projections > with > RTK? > > I already studied the Sphere reconstruction tuto, but it does not help me > to > understand how I can make use of my ".mhd" files in the RTK algorithms. I > will do further research work. > > Regards, > > Laura Trubuil > > > > Le 05/05/2013 11:20, Simon Rit a ?crit : > > Dear Laura, > I think that in the latest version of Gate, you should be able to > write mhd files. hdr file format should also work in both platforms. > What happens if you change the extension of your output files to .mhd? > Regards, > Simon > > On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL > wrote: > > Hi Laura, > > In the .mhd and .raw format, the .raw file is a binary file of floats > (or > whatever) representing the pixel intensities, and the .mhd a simple > header > that indicates the number of dimensions, the size in pixels along each > dimension, ... Your .dat seems to be exactly the same as the .raw > You can create the .mhd header yourself, using a text editor. Here is > an > example : > > ObjectType = Image > NDims = 2 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 1 > Offset = -190.5 -190.5 > CenterOfRotation = 0 0 > ElementSpacing = 3 3 > DimSize = 128 128 > ElementType = MET_FLOAT > ElementDataFile = SheppLogan.raw (try to replace this field with your > .dat filename) > > If I were you, I'd start by trying to adjust these parameters until you > manage to visualize a single projection (there are plenty of viewers > that > open mhd/raw files), and then create a header for the whole sequence > (NDims > = 3, etc ...) and concatenate the .dat binary files into a single one. > You > could use a script like the following : > > #!/bin/bash > # Concatenate all projections into a single raw file > NbProj=300 > i=0 > list="projection${i}.raw" > for i in $(seq 1 1 $(($NbProj-1))) > do > list="$list projection${i}.raw" > done > cat $list > SheppLogan.raw > > which would concatenate all files named "projection0.raw", > "projection1.raw", ... into "SheppLogan.raw" > > > -----Message d'origine----- > De : rtk-users-bounces at openrtk.org > [mailto:rtk-users-bounces at openrtk.org] > De la part de Laura Trubuil > Envoy? : jeudi 2 mai 2013 09:29 > ? : rtk-users at openrtk.org > Objet : [Rtk-users] .dat to .mha image > > Dear RTK users, > > I am working on GATE (from Geant4), to create projections images of > tomosynthesis. > I have projections but they are in ".dat" format (binary matrix of > float > numbers that stores the simulated tomosynthesis image and is produced > for > each time slice). > > I want to reconstruct a 3D volume, from projections, with RTK. > To do that, I know I must change the format of my images (for example > to > .mhd/.raw or to .mha format) but my problem is that I do not know how. > > I anyone could help... > > Regards, > > Laura > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > ________________________________ > The information contained in this message may be confidential and > legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby > notified > that any use, forwarding, dissemination, or reproduction of this > message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all > copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From laura.trubuil at mail.medecom.fr Wed May 29 03:49:06 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 09:49:06 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> Message-ID: <51A5B2F2.9060302@mail.medecom.fr> Dear Simon, Thank you for your answer. I have tried this morning both of your techniques but, unfortunately, I obtain the same result as I had previously. There is still something I am missing I guess... If anybody has suggestions! Regards, Laura Le 28/05/2013 20:30, Simon Rit a ?crit : > Hi Laura, > I think you are missing a point in the geometry definition. By > default, it assumes that the ray going through the source and the > isocenter (point of coordinate 0 0 0 in the volume) is intersecting > the projection at coordinate (0 0). In the projection that you have > sent, (0 0) is the corner of your image. > Two solutions : > - run the geometry specifying the translation > rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 > --proj_iso_x -50 --proj_iso_y -50 > rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml > - Change the origin of your image in your mhd file by adding the following line > Offset = -50 -50 > Simon > > On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil > wrote: >> Dear RTK-users, >> >> I am working on reconstruction with RTK backprojection algorithm. >> RTK Wiki examples worked fine but now, I am trying with my own images, and I >> obtain a result I cannot explain. >> >> I have 15 projections, simulated with GATE. My phantom is a water cylinder, >> containing 4 balls of different materials. >> I attached one of them with the mail, to give an example (the other are >> quite similar, only the place of the balls changes). >> >> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >> geometry.xml -n 15 --sdd 300 --sid 150 >> and then apply rtkbackprojection with : rtkbackprojections -o output.mha -g >> geometry.xml -r header.mhd -p. >> I display output.mha with VTK and obtain a white cube... >> >> Does anybody have an idea of what I am missing? Is the number of projections >> too small? Is it a display problem? >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 13/05/2013 16:14, Simon Rit a ?crit : >> >> Dear Laura, >> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >> by the angular gap (angular distance between the previous and the next >> projection) so that will be a problem. If you only use the >> backprojection, that should not be a problem. >> With FDK, there are a few solutions, the simplest being to trick the >> algorithm by adding 2 projections with zeros at the beginning and the >> end of your tomosynthesis acquisition. >> If you have some problems with the geometry, don't hesitate to provide >> your Gate macros and we can try to help. >> Simon >> >> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> Thank you for your help. >> >> It is a circular cone beam CT, yes. >> In fact, what I precisely do is working on tomosynthesis. I use the CT >> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >> only differences are that the X-Ray dose is lower, and the angle is not 360? >> but 40? maximum. I do not think it is a problem for RTK, is it? >> First, I intend to use RTK backprojection, and then, I will try to enhance >> the quality of the reconstruction by filtering techniques. >> >> I have already done some simulations on GATE, for small animal in a first >> time (because the computation time is too long for real human chest >> detectors, which are much bigger). It allows me to work on algorithms and >> test reconstruction with something, for the moment! I will be glad to help >> you if I can. >> >> I will continue studying RTK examples, I will let you know if I make some >> progress. Thanks again. >> >> Regards, >> >> Laura >> >> >> Le 07/05/2013 01:50, Simon Rit a ?crit : >> >> Hi, >> I don't know the CT simulation module of Gate so I can't help you. I >> will discuss this matter with my colleagues. We are currently working >> on a new CT simulation module but we definitely need to investigate >> how one can reconstruct from the existing module. What is the geometry >> of the scanner, is it circular cone-beam CT? It is the only geometry >> that RTK can handle. >> To understand how to use mhd files, you can look at other examples on >> RTK wiki. We will work on your problem and I'll let you know as soon >> as we have progressed but keep us informed if you make some progresses >> on your side. >> Regards, >> Simon >> >> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >> wrote: >> >> Dear Simon, >> >> Thank you for your answer. >> I am using the CT Scanner simulation in GATE, so the output available >> are >> the ".root" and the ".dat" only. >> >> First, I simply tried to change the extension ".dat" to ".mhd" or to >> ".raw" >> but, as expected, it does not work because I need to specifiy which kind >> of >> data the file contains (the role of the header in fact...). >> Then, I tried to do something with the GateToImage Class, which contains >> a >> function called WriteMHD, but it was not a success... I did not find a >> way >> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >> when I decided to ask the RTK users! >> >> With M. Mory's method, I am now able to open my ".dat" files with >> ImageFileReader function from ITK, and visualize it with VTK. >> >> >> For the moment, I am trying to reconstruct slices from 15 projections >> acquired with the CT Scanner example in GATE. >> Have you got any example of reconstruction of slices from projections >> with >> RTK? >> >> I already studied the Sphere reconstruction tuto, but it does not help me >> to >> understand how I can make use of my ".mhd" files in the RTK algorithms. I >> will do further research work. >> >> Regards, >> >> Laura Trubuil >> >> >> >> Le 05/05/2013 11:20, Simon Rit a ?crit : >> >> Dear Laura, >> I think that in the latest version of Gate, you should be able to >> write mhd files. hdr file format should also work in both platforms. >> What happens if you change the extension of your output files to .mhd? >> Regards, >> Simon >> >> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >> wrote: >> >> Hi Laura, >> >> In the .mhd and .raw format, the .raw file is a binary file of floats >> (or >> whatever) representing the pixel intensities, and the .mhd a simple >> header >> that indicates the number of dimensions, the size in pixels along each >> dimension, ... Your .dat seems to be exactly the same as the .raw >> You can create the .mhd header yourself, using a text editor. Here is >> an >> example : >> >> ObjectType = Image >> NDims = 2 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = False >> TransformMatrix = 1 0 0 1 >> Offset = -190.5 -190.5 >> CenterOfRotation = 0 0 >> ElementSpacing = 3 3 >> DimSize = 128 128 >> ElementType = MET_FLOAT >> ElementDataFile = SheppLogan.raw (try to replace this field with your >> .dat filename) >> >> If I were you, I'd start by trying to adjust these parameters until you >> manage to visualize a single projection (there are plenty of viewers >> that >> open mhd/raw files), and then create a header for the whole sequence >> (NDims >> = 3, etc ...) and concatenate the .dat binary files into a single one. >> You >> could use a script like the following : >> >> #!/bin/bash >> # Concatenate all projections into a single raw file >> NbProj=300 >> i=0 >> list="projection${i}.raw" >> for i in $(seq 1 1 $(($NbProj-1))) >> do >> list="$list projection${i}.raw" >> done >> cat $list > SheppLogan.raw >> >> which would concatenate all files named "projection0.raw", >> "projection1.raw", ... into "SheppLogan.raw" >> >> >> -----Message d'origine----- >> De : rtk-users-bounces at openrtk.org >> [mailto:rtk-users-bounces at openrtk.org] >> De la part de Laura Trubuil >> Envoy? : jeudi 2 mai 2013 09:29 >> ? : rtk-users at openrtk.org >> Objet : [Rtk-users] .dat to .mha image >> >> Dear RTK users, >> >> I am working on GATE (from Geant4), to create projections images of >> tomosynthesis. >> I have projections but they are in ".dat" format (binary matrix of >> float >> numbers that stores the simulated tomosynthesis image and is produced >> for >> each time slice). >> >> I want to reconstruct a 3D volume, from projections, with RTK. >> To do that, I know I must change the format of my images (for example >> to >> .mhd/.raw or to .mha format) but my problem is that I do not know how. >> >> I anyone could help... >> >> Regards, >> >> Laura >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> ________________________________ >> The information contained in this message may be confidential and >> legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby >> notified >> that any use, forwarding, dissemination, or reproduction of this >> message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all >> copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> From simon.rit at creatis.insa-lyon.fr Wed May 29 03:52:55 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 09:52:55 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5B2F2.9060302@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: I think you do not use an adequate window level when you display your image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL is adjusted to the min / max of your image. Simon On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil wrote: > Dear Simon, > Thank you for your answer. > I have tried this morning both of your techniques but, unfortunately, I > obtain the same result as I had previously. There is still something I am > missing I guess... If anybody has suggestions! > Regards, > > Laura > > > > Le 28/05/2013 20:30, Simon Rit a ?crit : > >> Hi Laura, >> I think you are missing a point in the geometry definition. By >> default, it assumes that the ray going through the source and the >> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >> the projection at coordinate (0 0). In the projection that you have >> sent, (0 0) is the corner of your image. >> Two solutions : >> - run the geometry specifying the translation >> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >> --proj_iso_x -50 --proj_iso_y -50 >> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >> - Change the origin of your image in your mhd file by adding the following >> line >> Offset = -50 -50 >> Simon >> >> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >> wrote: >>> >>> Dear RTK-users, >>> >>> I am working on reconstruction with RTK backprojection algorithm. >>> RTK Wiki examples worked fine but now, I am trying with my own images, >>> and I >>> obtain a result I cannot explain. >>> >>> I have 15 projections, simulated with GATE. My phantom is a water >>> cylinder, >>> containing 4 balls of different materials. >>> I attached one of them with the mail, to give an example (the other are >>> quite similar, only the place of the balls changes). >>> >>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>> geometry.xml -n 15 --sdd 300 --sid 150 >>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>> -g >>> geometry.xml -r header.mhd -p. >>> I display output.mha with VTK and obtain a white cube... >>> >>> Does anybody have an idea of what I am missing? Is the number of >>> projections >>> too small? Is it a display problem? >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>> >>> Dear Laura, >>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>> by the angular gap (angular distance between the previous and the next >>> projection) so that will be a problem. If you only use the >>> backprojection, that should not be a problem. >>> With FDK, there are a few solutions, the simplest being to trick the >>> algorithm by adding 2 projections with zeros at the beginning and the >>> end of your tomosynthesis acquisition. >>> If you have some problems with the geometry, don't hesitate to provide >>> your Gate macros and we can try to help. >>> Simon >>> >>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> Thank you for your help. >>> >>> It is a circular cone beam CT, yes. >>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>> only differences are that the X-Ray dose is lower, and the angle is not >>> 360? >>> but 40? maximum. I do not think it is a problem for RTK, is it? >>> First, I intend to use RTK backprojection, and then, I will try to >>> enhance >>> the quality of the reconstruction by filtering techniques. >>> >>> I have already done some simulations on GATE, for small animal in a first >>> time (because the computation time is too long for real human chest >>> detectors, which are much bigger). It allows me to work on algorithms and >>> test reconstruction with something, for the moment! I will be glad to >>> help >>> you if I can. >>> >>> I will continue studying RTK examples, I will let you know if I make some >>> progress. Thanks again. >>> >>> Regards, >>> >>> Laura >>> >>> >>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>> >>> Hi, >>> I don't know the CT simulation module of Gate so I can't help you. I >>> will discuss this matter with my colleagues. We are currently working >>> on a new CT simulation module but we definitely need to investigate >>> how one can reconstruct from the existing module. What is the geometry >>> of the scanner, is it circular cone-beam CT? It is the only geometry >>> that RTK can handle. >>> To understand how to use mhd files, you can look at other examples on >>> RTK wiki. We will work on your problem and I'll let you know as soon >>> as we have progressed but keep us informed if you make some progresses >>> on your side. >>> Regards, >>> Simon >>> >>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>> wrote: >>> >>> Dear Simon, >>> >>> Thank you for your answer. >>> I am using the CT Scanner simulation in GATE, so the output available >>> are >>> the ".root" and the ".dat" only. >>> >>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>> ".raw" >>> but, as expected, it does not work because I need to specifiy which kind >>> of >>> data the file contains (the role of the header in fact...). >>> Then, I tried to do something with the GateToImage Class, which contains >>> a >>> function called WriteMHD, but it was not a success... I did not find a >>> way >>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>> when I decided to ask the RTK users! >>> >>> With M. Mory's method, I am now able to open my ".dat" files with >>> ImageFileReader function from ITK, and visualize it with VTK. >>> >>> >>> For the moment, I am trying to reconstruct slices from 15 projections >>> acquired with the CT Scanner example in GATE. >>> Have you got any example of reconstruction of slices from projections >>> with >>> RTK? >>> >>> I already studied the Sphere reconstruction tuto, but it does not help me >>> to >>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>> will do further research work. >>> >>> Regards, >>> >>> Laura Trubuil >>> >>> >>> >>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>> >>> Dear Laura, >>> I think that in the latest version of Gate, you should be able to >>> write mhd files. hdr file format should also work in both platforms. >>> What happens if you change the extension of your output files to .mhd? >>> Regards, >>> Simon >>> >>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>> wrote: >>> >>> Hi Laura, >>> >>> In the .mhd and .raw format, the .raw file is a binary file of floats >>> (or >>> whatever) representing the pixel intensities, and the .mhd a simple >>> header >>> that indicates the number of dimensions, the size in pixels along each >>> dimension, ... Your .dat seems to be exactly the same as the .raw >>> You can create the .mhd header yourself, using a text editor. Here is >>> an >>> example : >>> >>> ObjectType = Image >>> NDims = 2 >>> BinaryData = True >>> BinaryDataByteOrderMSB = False >>> CompressedData = False >>> TransformMatrix = 1 0 0 1 >>> Offset = -190.5 -190.5 >>> CenterOfRotation = 0 0 >>> ElementSpacing = 3 3 >>> DimSize = 128 128 >>> ElementType = MET_FLOAT >>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>> .dat filename) >>> >>> If I were you, I'd start by trying to adjust these parameters until you >>> manage to visualize a single projection (there are plenty of viewers >>> that >>> open mhd/raw files), and then create a header for the whole sequence >>> (NDims >>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>> You >>> could use a script like the following : >>> >>> #!/bin/bash >>> # Concatenate all projections into a single raw file >>> NbProj=300 >>> i=0 >>> list="projection${i}.raw" >>> for i in $(seq 1 1 $(($NbProj-1))) >>> do >>> list="$list projection${i}.raw" >>> done >>> cat $list > SheppLogan.raw >>> >>> which would concatenate all files named "projection0.raw", >>> "projection1.raw", ... into "SheppLogan.raw" >>> >>> >>> -----Message d'origine----- >>> De : rtk-users-bounces at openrtk.org >>> [mailto:rtk-users-bounces at openrtk.org] >>> De la part de Laura Trubuil >>> Envoy? : jeudi 2 mai 2013 09:29 >>> ? : rtk-users at openrtk.org >>> Objet : [Rtk-users] .dat to .mha image >>> >>> Dear RTK users, >>> >>> I am working on GATE (from Geant4), to create projections images of >>> tomosynthesis. >>> I have projections but they are in ".dat" format (binary matrix of >>> float >>> numbers that stores the simulated tomosynthesis image and is produced >>> for >>> each time slice). >>> >>> I want to reconstruct a 3D volume, from projections, with RTK. >>> To do that, I know I must change the format of my images (for example >>> to >>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>> >>> I anyone could help... >>> >>> Regards, >>> >>> Laura >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> ________________________________ >>> The information contained in this message may be confidential and >>> legally >>> protected under applicable law. The message is intended solely for the >>> addressee(s). If you are not the intended recipient, you are hereby >>> notified >>> that any use, forwarding, dissemination, or reproduction of this >>> message is >>> strictly prohibited and may be unlawful. If you are not the intended >>> recipient, please contact the sender by return e-mail and destroy all >>> copies >>> of the original message. >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> >>> >>> >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at openrtk.org >>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 06:05:33 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 12:05:33 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> Message-ID: <51A5D2ED.9020401@mail.medecom.fr> I am sorry to annoy you again but I installed VV and read my backprojection reconstruction (outputBP.mha) with it. It seems that I obtain a cube with a pyramid inside. Not what I expected from a backprojection, I really do not understand. Laura Le 29/05/2013 09:52, Simon Rit a ?crit : > I think you do not use an adequate window level when you display your > image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL > is adjusted to the min / max of your image. > Simon > > On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil > wrote: >> Dear Simon, >> Thank you for your answer. >> I have tried this morning both of your techniques but, unfortunately, I >> obtain the same result as I had previously. There is still something I am >> missing I guess... If anybody has suggestions! >> Regards, >> >> Laura >> >> >> >> Le 28/05/2013 20:30, Simon Rit a ?crit : >> >>> Hi Laura, >>> I think you are missing a point in the geometry definition. By >>> default, it assumes that the ray going through the source and the >>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>> the projection at coordinate (0 0). In the projection that you have >>> sent, (0 0) is the corner of your image. >>> Two solutions : >>> - run the geometry specifying the translation >>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>> --proj_iso_x -50 --proj_iso_y -50 >>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml >>> - Change the origin of your image in your mhd file by adding the following >>> line >>> Offset = -50 -50 >>> Simon >>> >>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>> wrote: >>>> Dear RTK-users, >>>> >>>> I am working on reconstruction with RTK backprojection algorithm. >>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>> and I >>>> obtain a result I cannot explain. >>>> >>>> I have 15 projections, simulated with GATE. My phantom is a water >>>> cylinder, >>>> containing 4 balls of different materials. >>>> I attached one of them with the mail, to give an example (the other are >>>> quite similar, only the place of the balls changes). >>>> >>>> I generate a geometry.xml file with the command : rtksimulatedgeometry -o >>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>> and then apply rtkbackprojection with : rtkbackprojections -o output.mha >>>> -g >>>> geometry.xml -r header.mhd -p. >>>> I display output.mha with VTK and obtain a white cube... >>>> >>>> Does anybody have an idea of what I am missing? Is the number of >>>> projections >>>> too small? Is it a display problem? >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>> by the angular gap (angular distance between the previous and the next >>>> projection) so that will be a problem. If you only use the >>>> backprojection, that should not be a problem. >>>> With FDK, there are a few solutions, the simplest being to trick the >>>> algorithm by adding 2 projections with zeros at the beginning and the >>>> end of your tomosynthesis acquisition. >>>> If you have some problems with the geometry, don't hesitate to provide >>>> your Gate macros and we can try to help. >>>> Simon >>>> >>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> Thank you for your help. >>>> >>>> It is a circular cone beam CT, yes. >>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. The >>>> only differences are that the X-Ray dose is lower, and the angle is not >>>> 360? >>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>> First, I intend to use RTK backprojection, and then, I will try to >>>> enhance >>>> the quality of the reconstruction by filtering techniques. >>>> >>>> I have already done some simulations on GATE, for small animal in a first >>>> time (because the computation time is too long for real human chest >>>> detectors, which are much bigger). It allows me to work on algorithms and >>>> test reconstruction with something, for the moment! I will be glad to >>>> help >>>> you if I can. >>>> >>>> I will continue studying RTK examples, I will let you know if I make some >>>> progress. Thanks again. >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>> >>>> Hi, >>>> I don't know the CT simulation module of Gate so I can't help you. I >>>> will discuss this matter with my colleagues. We are currently working >>>> on a new CT simulation module but we definitely need to investigate >>>> how one can reconstruct from the existing module. What is the geometry >>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>> that RTK can handle. >>>> To understand how to use mhd files, you can look at other examples on >>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>> as we have progressed but keep us informed if you make some progresses >>>> on your side. >>>> Regards, >>>> Simon >>>> >>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>> wrote: >>>> >>>> Dear Simon, >>>> >>>> Thank you for your answer. >>>> I am using the CT Scanner simulation in GATE, so the output available >>>> are >>>> the ".root" and the ".dat" only. >>>> >>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>> ".raw" >>>> but, as expected, it does not work because I need to specifiy which kind >>>> of >>>> data the file contains (the role of the header in fact...). >>>> Then, I tried to do something with the GateToImage Class, which contains >>>> a >>>> function called WriteMHD, but it was not a success... I did not find a >>>> way >>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is >>>> when I decided to ask the RTK users! >>>> >>>> With M. Mory's method, I am now able to open my ".dat" files with >>>> ImageFileReader function from ITK, and visualize it with VTK. >>>> >>>> >>>> For the moment, I am trying to reconstruct slices from 15 projections >>>> acquired with the CT Scanner example in GATE. >>>> Have you got any example of reconstruction of slices from projections >>>> with >>>> RTK? >>>> >>>> I already studied the Sphere reconstruction tuto, but it does not help me >>>> to >>>> understand how I can make use of my ".mhd" files in the RTK algorithms. I >>>> will do further research work. >>>> >>>> Regards, >>>> >>>> Laura Trubuil >>>> >>>> >>>> >>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>> >>>> Dear Laura, >>>> I think that in the latest version of Gate, you should be able to >>>> write mhd files. hdr file format should also work in both platforms. >>>> What happens if you change the extension of your output files to .mhd? >>>> Regards, >>>> Simon >>>> >>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>> wrote: >>>> >>>> Hi Laura, >>>> >>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>> (or >>>> whatever) representing the pixel intensities, and the .mhd a simple >>>> header >>>> that indicates the number of dimensions, the size in pixels along each >>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>> You can create the .mhd header yourself, using a text editor. Here is >>>> an >>>> example : >>>> >>>> ObjectType = Image >>>> NDims = 2 >>>> BinaryData = True >>>> BinaryDataByteOrderMSB = False >>>> CompressedData = False >>>> TransformMatrix = 1 0 0 1 >>>> Offset = -190.5 -190.5 >>>> CenterOfRotation = 0 0 >>>> ElementSpacing = 3 3 >>>> DimSize = 128 128 >>>> ElementType = MET_FLOAT >>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>> .dat filename) >>>> >>>> If I were you, I'd start by trying to adjust these parameters until you >>>> manage to visualize a single projection (there are plenty of viewers >>>> that >>>> open mhd/raw files), and then create a header for the whole sequence >>>> (NDims >>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>> You >>>> could use a script like the following : >>>> >>>> #!/bin/bash >>>> # Concatenate all projections into a single raw file >>>> NbProj=300 >>>> i=0 >>>> list="projection${i}.raw" >>>> for i in $(seq 1 1 $(($NbProj-1))) >>>> do >>>> list="$list projection${i}.raw" >>>> done >>>> cat $list > SheppLogan.raw >>>> >>>> which would concatenate all files named "projection0.raw", >>>> "projection1.raw", ... into "SheppLogan.raw" >>>> >>>> >>>> -----Message d'origine----- >>>> De : rtk-users-bounces at openrtk.org >>>> [mailto:rtk-users-bounces at openrtk.org] >>>> De la part de Laura Trubuil >>>> Envoy? : jeudi 2 mai 2013 09:29 >>>> ? : rtk-users at openrtk.org >>>> Objet : [Rtk-users] .dat to .mha image >>>> >>>> Dear RTK users, >>>> >>>> I am working on GATE (from Geant4), to create projections images of >>>> tomosynthesis. >>>> I have projections but they are in ".dat" format (binary matrix of >>>> float >>>> numbers that stores the simulated tomosynthesis image and is produced >>>> for >>>> each time slice). >>>> >>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>> To do that, I know I must change the format of my images (for example >>>> to >>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>> >>>> I anyone could help... >>>> >>>> Regards, >>>> >>>> Laura >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> ________________________________ >>>> The information contained in this message may be confidential and >>>> legally >>>> protected under applicable law. The message is intended solely for the >>>> addressee(s). If you are not the intended recipient, you are hereby >>>> notified >>>> that any use, forwarding, dissemination, or reproduction of this >>>> message is >>>> strictly prohibited and may be unlawful. If you are not the intended >>>> recipient, please contact the sender by return e-mail and destroy all >>>> copies >>>> of the original message. >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at openrtk.org >>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>> >> From simon.rit at creatis.insa-lyon.fr Wed May 29 06:56:00 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 29 May 2013 12:56:00 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: <51A5D2ED.9020401@mail.medecom.fr> References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: I'm not sure what you expected but this is the definition of the backprojection operator : assign to the voxels along each ray the value at the intersection between the ray and the projection image. So with a cone-beam geometry and a squared projection, you obtain a pyramid provided that the volume is large enough. Maybe you should try to obtain some basic information on filtered backprojection from a person in your group or in a book? Kak and Slaney's book is famous and freely available online: http://www.slaney.org/pct/ Simon On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil wrote: > I am sorry to annoy you again but I installed VV and read my backprojection > reconstruction (outputBP.mha) with it. > It seems that I obtain a cube with a pyramid inside. Not what I expected > from a backprojection, I really do not understand. > > Laura > > > Le 29/05/2013 09:52, Simon Rit a ?crit : > >> I think you do not use an adequate window level when you display your >> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >> is adjusted to the min / max of your image. >> Simon >> >> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >> wrote: >>> >>> Dear Simon, >>> Thank you for your answer. >>> I have tried this morning both of your techniques but, unfortunately, I >>> obtain the same result as I had previously. There is still something I am >>> missing I guess... If anybody has suggestions! >>> Regards, >>> >>> Laura >>> >>> >>> >>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>> >>>> Hi Laura, >>>> I think you are missing a point in the geometry definition. By >>>> default, it assumes that the ray going through the source and the >>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>> the projection at coordinate (0 0). In the projection that you have >>>> sent, (0 0) is the corner of your image. >>>> Two solutions : >>>> - run the geometry specifying the translation >>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>> --proj_iso_x -50 --proj_iso_y -50 >>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>> geometry.xml >>>> - Change the origin of your image in your mhd file by adding the >>>> following >>>> line >>>> Offset = -50 -50 >>>> Simon >>>> >>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>> wrote: >>>>> >>>>> Dear RTK-users, >>>>> >>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>> and I >>>>> obtain a result I cannot explain. >>>>> >>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>> cylinder, >>>>> containing 4 balls of different materials. >>>>> I attached one of them with the mail, to give an example (the other are >>>>> quite similar, only the place of the balls changes). >>>>> >>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>> -o >>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>> output.mha >>>>> -g >>>>> geometry.xml -r header.mhd -p. >>>>> I display output.mha with VTK and obtain a white cube... >>>>> >>>>> Does anybody have an idea of what I am missing? Is the number of >>>>> projections >>>>> too small? Is it a display problem? >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>> by the angular gap (angular distance between the previous and the next >>>>> projection) so that will be a problem. If you only use the >>>>> backprojection, that should not be a problem. >>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>> end of your tomosynthesis acquisition. >>>>> If you have some problems with the geometry, don't hesitate to provide >>>>> your Gate macros and we can try to help. >>>>> Simon >>>>> >>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> Thank you for your help. >>>>> >>>>> It is a circular cone beam CT, yes. >>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>> The >>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>> 360? >>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>> enhance >>>>> the quality of the reconstruction by filtering techniques. >>>>> >>>>> I have already done some simulations on GATE, for small animal in a >>>>> first >>>>> time (because the computation time is too long for real human chest >>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>> and >>>>> test reconstruction with something, for the moment! I will be glad to >>>>> help >>>>> you if I can. >>>>> >>>>> I will continue studying RTK examples, I will let you know if I make >>>>> some >>>>> progress. Thanks again. >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> >>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>> >>>>> Hi, >>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>> will discuss this matter with my colleagues. We are currently working >>>>> on a new CT simulation module but we definitely need to investigate >>>>> how one can reconstruct from the existing module. What is the geometry >>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>> that RTK can handle. >>>>> To understand how to use mhd files, you can look at other examples on >>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>> as we have progressed but keep us informed if you make some progresses >>>>> on your side. >>>>> Regards, >>>>> Simon >>>>> >>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>> wrote: >>>>> >>>>> Dear Simon, >>>>> >>>>> Thank you for your answer. >>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>> are >>>>> the ".root" and the ".dat" only. >>>>> >>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>> ".raw" >>>>> but, as expected, it does not work because I need to specifiy which >>>>> kind >>>>> of >>>>> data the file contains (the role of the header in fact...). >>>>> Then, I tried to do something with the GateToImage Class, which >>>>> contains >>>>> a >>>>> function called WriteMHD, but it was not a success... I did not find a >>>>> way >>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>> is >>>>> when I decided to ask the RTK users! >>>>> >>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>> >>>>> >>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>> acquired with the CT Scanner example in GATE. >>>>> Have you got any example of reconstruction of slices from projections >>>>> with >>>>> RTK? >>>>> >>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>> me >>>>> to >>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>> I >>>>> will do further research work. >>>>> >>>>> Regards, >>>>> >>>>> Laura Trubuil >>>>> >>>>> >>>>> >>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>> >>>>> Dear Laura, >>>>> I think that in the latest version of Gate, you should be able to >>>>> write mhd files. hdr file format should also work in both platforms. >>>>> What happens if you change the extension of your output files to .mhd? >>>>> Regards, >>>>> Simon >>>>> >>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>> wrote: >>>>> >>>>> Hi Laura, >>>>> >>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>> (or >>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>> header >>>>> that indicates the number of dimensions, the size in pixels along each >>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>> an >>>>> example : >>>>> >>>>> ObjectType = Image >>>>> NDims = 2 >>>>> BinaryData = True >>>>> BinaryDataByteOrderMSB = False >>>>> CompressedData = False >>>>> TransformMatrix = 1 0 0 1 >>>>> Offset = -190.5 -190.5 >>>>> CenterOfRotation = 0 0 >>>>> ElementSpacing = 3 3 >>>>> DimSize = 128 128 >>>>> ElementType = MET_FLOAT >>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>> .dat filename) >>>>> >>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>> manage to visualize a single projection (there are plenty of viewers >>>>> that >>>>> open mhd/raw files), and then create a header for the whole sequence >>>>> (NDims >>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>> You >>>>> could use a script like the following : >>>>> >>>>> #!/bin/bash >>>>> # Concatenate all projections into a single raw file >>>>> NbProj=300 >>>>> i=0 >>>>> list="projection${i}.raw" >>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>> do >>>>> list="$list projection${i}.raw" >>>>> done >>>>> cat $list > SheppLogan.raw >>>>> >>>>> which would concatenate all files named "projection0.raw", >>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>> >>>>> >>>>> -----Message d'origine----- >>>>> De : rtk-users-bounces at openrtk.org >>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>> De la part de Laura Trubuil >>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>> ? : rtk-users at openrtk.org >>>>> Objet : [Rtk-users] .dat to .mha image >>>>> >>>>> Dear RTK users, >>>>> >>>>> I am working on GATE (from Geant4), to create projections images of >>>>> tomosynthesis. >>>>> I have projections but they are in ".dat" format (binary matrix of >>>>> float >>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>> for >>>>> each time slice). >>>>> >>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>> To do that, I know I must change the format of my images (for example >>>>> to >>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>> >>>>> I anyone could help... >>>>> >>>>> Regards, >>>>> >>>>> Laura >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> ________________________________ >>>>> The information contained in this message may be confidential and >>>>> legally >>>>> protected under applicable law. The message is intended solely for the >>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>> notified >>>>> that any use, forwarding, dissemination, or reproduction of this >>>>> message is >>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>> recipient, please contact the sender by return e-mail and destroy all >>>>> copies >>>>> of the original message. >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at openrtk.org >>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>> >>> > > From laura.trubuil at mail.medecom.fr Wed May 29 07:06:35 2013 From: laura.trubuil at mail.medecom.fr (Laura Trubuil) Date: Wed, 29 May 2013 13:06:35 +0200 Subject: [Rtk-users] .dat to .mha image In-Reply-To: References: <518215D8.3010501@mail.medecom.fr> <3B67D2F1029933428E0E93E2C2F1801334F80258@011-DB3MPN1-042.MGDPHG.emi.philips.com> <518759EC.8060709@mail.medecom.fr> <5188B5CB.4080508@mail.medecom.fr> <51A36349.1030804@mail.medecom.fr> <51A5B2F2.9060302@mail.medecom.fr> <51A5D2ED.9020401@mail.medecom.fr> Message-ID: <51A5E13B.9050402@mail.medecom.fr> Ok I will do further reasearches and take a look at that book. Thanks again! Laura Le 29/05/2013 12:56, Simon Rit a ?crit : > I'm not sure what you expected but this is the definition of the > backprojection operator : assign to the voxels along each ray the > value at the intersection between the ray and the projection image. So > with a cone-beam geometry and a squared projection, you obtain a > pyramid provided that the volume is large enough. Maybe you should try > to obtain some basic information on filtered backprojection from a > person in your group or in a book? Kak and Slaney's book is famous and > freely available online: > http://www.slaney.org/pct/ > Simon > > On Wed, May 29, 2013 at 12:05 PM, Laura Trubuil > wrote: >> I am sorry to annoy you again but I installed VV and read my backprojection >> reconstruction (outputBP.mha) with it. >> It seems that I obtain a cube with a pyramid inside. Not what I expected >> from a backprojection, I really do not understand. >> >> Laura >> >> >> Le 29/05/2013 09:52, Simon Rit a ?crit : >> >>> I think you do not use an adequate window level when you display your >>> image. Try using vv (http://vv.creatis.insa-lyon.fr) which default WL >>> is adjusted to the min / max of your image. >>> Simon >>> >>> On Wed, May 29, 2013 at 9:49 AM, Laura Trubuil >>> wrote: >>>> Dear Simon, >>>> Thank you for your answer. >>>> I have tried this morning both of your techniques but, unfortunately, I >>>> obtain the same result as I had previously. There is still something I am >>>> missing I guess... If anybody has suggestions! >>>> Regards, >>>> >>>> Laura >>>> >>>> >>>> >>>> Le 28/05/2013 20:30, Simon Rit a ?crit : >>>> >>>>> Hi Laura, >>>>> I think you are missing a point in the geometry definition. By >>>>> default, it assumes that the ray going through the source and the >>>>> isocenter (point of coordinate 0 0 0 in the volume) is intersecting >>>>> the projection at coordinate (0 0). In the projection that you have >>>>> sent, (0 0) is the corner of your image. >>>>> Two solutions : >>>>> - run the geometry specifying the translation >>>>> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150 >>>>> --proj_iso_x -50 --proj_iso_y -50 >>>>> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g >>>>> geometry.xml >>>>> - Change the origin of your image in your mhd file by adding the >>>>> following >>>>> line >>>>> Offset = -50 -50 >>>>> Simon >>>>> >>>>> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil >>>>> wrote: >>>>>> Dear RTK-users, >>>>>> >>>>>> I am working on reconstruction with RTK backprojection algorithm. >>>>>> RTK Wiki examples worked fine but now, I am trying with my own images, >>>>>> and I >>>>>> obtain a result I cannot explain. >>>>>> >>>>>> I have 15 projections, simulated with GATE. My phantom is a water >>>>>> cylinder, >>>>>> containing 4 balls of different materials. >>>>>> I attached one of them with the mail, to give an example (the other are >>>>>> quite similar, only the place of the balls changes). >>>>>> >>>>>> I generate a geometry.xml file with the command : rtksimulatedgeometry >>>>>> -o >>>>>> geometry.xml -n 15 --sdd 300 --sid 150 >>>>>> and then apply rtkbackprojection with : rtkbackprojections -o >>>>>> output.mha >>>>>> -g >>>>>> geometry.xml -r header.mhd -p. >>>>>> I display output.mha with VTK and obtain a white cube... >>>>>> >>>>>> Does anybody have an idea of what I am missing? Is the number of >>>>>> projections >>>>>> too small? Is it a display problem? >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 13/05/2013 16:14, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting >>>>>> by the angular gap (angular distance between the previous and the next >>>>>> projection) so that will be a problem. If you only use the >>>>>> backprojection, that should not be a problem. >>>>>> With FDK, there are a few solutions, the simplest being to trick the >>>>>> algorithm by adding 2 projections with zeros at the beginning and the >>>>>> end of your tomosynthesis acquisition. >>>>>> If you have some problems with the geometry, don't hesitate to provide >>>>>> your Gate macros and we can try to help. >>>>>> Simon >>>>>> >>>>>> On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> Thank you for your help. >>>>>> >>>>>> It is a circular cone beam CT, yes. >>>>>> In fact, what I precisely do is working on tomosynthesis. I use the CT >>>>>> scanner simulator of GATE as a basis for a tomosynthesis simulation. >>>>>> The >>>>>> only differences are that the X-Ray dose is lower, and the angle is not >>>>>> 360? >>>>>> but 40? maximum. I do not think it is a problem for RTK, is it? >>>>>> First, I intend to use RTK backprojection, and then, I will try to >>>>>> enhance >>>>>> the quality of the reconstruction by filtering techniques. >>>>>> >>>>>> I have already done some simulations on GATE, for small animal in a >>>>>> first >>>>>> time (because the computation time is too long for real human chest >>>>>> detectors, which are much bigger). It allows me to work on algorithms >>>>>> and >>>>>> test reconstruction with something, for the moment! I will be glad to >>>>>> help >>>>>> you if I can. >>>>>> >>>>>> I will continue studying RTK examples, I will let you know if I make >>>>>> some >>>>>> progress. Thanks again. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> >>>>>> Le 07/05/2013 01:50, Simon Rit a ?crit : >>>>>> >>>>>> Hi, >>>>>> I don't know the CT simulation module of Gate so I can't help you. I >>>>>> will discuss this matter with my colleagues. We are currently working >>>>>> on a new CT simulation module but we definitely need to investigate >>>>>> how one can reconstruct from the existing module. What is the geometry >>>>>> of the scanner, is it circular cone-beam CT? It is the only geometry >>>>>> that RTK can handle. >>>>>> To understand how to use mhd files, you can look at other examples on >>>>>> RTK wiki. We will work on your problem and I'll let you know as soon >>>>>> as we have progressed but keep us informed if you make some progresses >>>>>> on your side. >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil >>>>>> wrote: >>>>>> >>>>>> Dear Simon, >>>>>> >>>>>> Thank you for your answer. >>>>>> I am using the CT Scanner simulation in GATE, so the output available >>>>>> are >>>>>> the ".root" and the ".dat" only. >>>>>> >>>>>> First, I simply tried to change the extension ".dat" to ".mhd" or to >>>>>> ".raw" >>>>>> but, as expected, it does not work because I need to specifiy which >>>>>> kind >>>>>> of >>>>>> data the file contains (the role of the header in fact...). >>>>>> Then, I tried to do something with the GateToImage Class, which >>>>>> contains >>>>>> a >>>>>> function called WriteMHD, but it was not a success... I did not find a >>>>>> way >>>>>> to directly obtain ".mhd" from a CT Scanner simulation from GATE. That >>>>>> is >>>>>> when I decided to ask the RTK users! >>>>>> >>>>>> With M. Mory's method, I am now able to open my ".dat" files with >>>>>> ImageFileReader function from ITK, and visualize it with VTK. >>>>>> >>>>>> >>>>>> For the moment, I am trying to reconstruct slices from 15 projections >>>>>> acquired with the CT Scanner example in GATE. >>>>>> Have you got any example of reconstruction of slices from projections >>>>>> with >>>>>> RTK? >>>>>> >>>>>> I already studied the Sphere reconstruction tuto, but it does not help >>>>>> me >>>>>> to >>>>>> understand how I can make use of my ".mhd" files in the RTK algorithms. >>>>>> I >>>>>> will do further research work. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura Trubuil >>>>>> >>>>>> >>>>>> >>>>>> Le 05/05/2013 11:20, Simon Rit a ?crit : >>>>>> >>>>>> Dear Laura, >>>>>> I think that in the latest version of Gate, you should be able to >>>>>> write mhd files. hdr file format should also work in both platforms. >>>>>> What happens if you change the extension of your output files to .mhd? >>>>>> Regards, >>>>>> Simon >>>>>> >>>>>> On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL >>>>>> wrote: >>>>>> >>>>>> Hi Laura, >>>>>> >>>>>> In the .mhd and .raw format, the .raw file is a binary file of floats >>>>>> (or >>>>>> whatever) representing the pixel intensities, and the .mhd a simple >>>>>> header >>>>>> that indicates the number of dimensions, the size in pixels along each >>>>>> dimension, ... Your .dat seems to be exactly the same as the .raw >>>>>> You can create the .mhd header yourself, using a text editor. Here is >>>>>> an >>>>>> example : >>>>>> >>>>>> ObjectType = Image >>>>>> NDims = 2 >>>>>> BinaryData = True >>>>>> BinaryDataByteOrderMSB = False >>>>>> CompressedData = False >>>>>> TransformMatrix = 1 0 0 1 >>>>>> Offset = -190.5 -190.5 >>>>>> CenterOfRotation = 0 0 >>>>>> ElementSpacing = 3 3 >>>>>> DimSize = 128 128 >>>>>> ElementType = MET_FLOAT >>>>>> ElementDataFile = SheppLogan.raw (try to replace this field with your >>>>>> .dat filename) >>>>>> >>>>>> If I were you, I'd start by trying to adjust these parameters until you >>>>>> manage to visualize a single projection (there are plenty of viewers >>>>>> that >>>>>> open mhd/raw files), and then create a header for the whole sequence >>>>>> (NDims >>>>>> = 3, etc ...) and concatenate the .dat binary files into a single one. >>>>>> You >>>>>> could use a script like the following : >>>>>> >>>>>> #!/bin/bash >>>>>> # Concatenate all projections into a single raw file >>>>>> NbProj=300 >>>>>> i=0 >>>>>> list="projection${i}.raw" >>>>>> for i in $(seq 1 1 $(($NbProj-1))) >>>>>> do >>>>>> list="$list projection${i}.raw" >>>>>> done >>>>>> cat $list > SheppLogan.raw >>>>>> >>>>>> which would concatenate all files named "projection0.raw", >>>>>> "projection1.raw", ... into "SheppLogan.raw" >>>>>> >>>>>> >>>>>> -----Message d'origine----- >>>>>> De : rtk-users-bounces at openrtk.org >>>>>> [mailto:rtk-users-bounces at openrtk.org] >>>>>> De la part de Laura Trubuil >>>>>> Envoy? : jeudi 2 mai 2013 09:29 >>>>>> ? : rtk-users at openrtk.org >>>>>> Objet : [Rtk-users] .dat to .mha image >>>>>> >>>>>> Dear RTK users, >>>>>> >>>>>> I am working on GATE (from Geant4), to create projections images of >>>>>> tomosynthesis. >>>>>> I have projections but they are in ".dat" format (binary matrix of >>>>>> float >>>>>> numbers that stores the simulated tomosynthesis image and is produced >>>>>> for >>>>>> each time slice). >>>>>> >>>>>> I want to reconstruct a 3D volume, from projections, with RTK. >>>>>> To do that, I know I must change the format of my images (for example >>>>>> to >>>>>> .mhd/.raw or to .mha format) but my problem is that I do not know how. >>>>>> >>>>>> I anyone could help... >>>>>> >>>>>> Regards, >>>>>> >>>>>> Laura >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> ________________________________ >>>>>> The information contained in this message may be confidential and >>>>>> legally >>>>>> protected under applicable law. The message is intended solely for the >>>>>> addressee(s). If you are not the intended recipient, you are hereby >>>>>> notified >>>>>> that any use, forwarding, dissemination, or reproduction of this >>>>>> message is >>>>>> strictly prohibited and may be unlawful. If you are not the intended >>>>>> recipient, please contact the sender by return e-mail and destroy all >>>>>> copies >>>>>> of the original message. >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at openrtk.org >>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >>>>>> >> From hsieandy at gmail.com Wed May 29 20:48:15 2013 From: hsieandy at gmail.com (Andy Shieh) Date: Thu, 30 May 2013 10:48:15 +1000 Subject: [Rtk-users] Citing RTK Message-ID: Hi Simon, I'm citing and acknowledging RTK in a manuscript I plan to submit in the near future. Is there any way that you prefer to be cited? For example, should we reference a specific paper of yours? Thanks! Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 02:36:52 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 08:36:52 +0200 Subject: [Rtk-users] Citing RTK In-Reply-To: References: Message-ID: Hi Andy, We have recently added the ICCR paper as a reference paper for citing RTK: http://wiki.openrtk.org/index.php/Main_Page#Citations The 4 pages paper is being written but there should be one when your paper will be published. Simon On Thu, May 30, 2013 at 2:48 AM, Andy Shieh wrote: > Hi Simon, > > I'm citing and acknowledging RTK in a manuscript I plan to submit in the > near future. Is there any way that you prefer to be cited? For example, > should we reference a specific paper of yours? Thanks! > > Cheers, > Andy > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Thu May 30 11:48:33 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Thu, 30 May 2013 15:48:33 +0000 Subject: [Rtk-users] Linker problem Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi, I've written a small filter deriving from rtk::BackProjectionImageFilter, because I needed to access the protected methods GetProjection() and GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. The filter has only two additional methods, both public, called PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which call their protected counterparts. The .h and .txx files are below. When creating this filter in my CUDA filter, I get an error message from the linker : ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In function `rtk::PublicBackProjectionImageFilter, itk::Image >::New()': /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: undefined reference to `rtk::PublicBackProjectionImageFilter, itk::Image >::PublicBackProjectionImageFilter()' collect2: error: ld returned 1 exit status It's probably a stupid mistake, but I can't find it. Can someone help me ? rtkPublicBackProjectionImageFilter.h #ifndef __rtkPublicBackProjectionImageFilter_h #define __rtkPublicBackProjectionImageFilter_h #include "rtkBackProjectionImageFilter.h" namespace rtk { /** \class PublicBackProjectionImageFilter * \brief BackProjectionImageFilter where protected methods are made public * * This filter exposes some of the methods that are protected in BackProjectionImageFilter * Required for CudaProjectionStackToFourDImageFilter * * \author Cyril Mory * * \ingroup Projector */ template class ITK_EXPORT PublicBackProjectionImageFilter : public rtk::BackProjectionImageFilter { public: /** Standard class typedefs. */ typedef PublicBackProjectionImageFilter Self; typedef itk::ImageToImageFilter Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef typename TInputImage::PixelType InputPixelType; typedef typename TOutputImage::RegionType OutputImageRegionType; typedef rtk::ProjectionGeometry GeometryType; typedef typename GeometryType::Pointer GeometryPointer; typedef typename GeometryType::MatrixType ProjectionMatrixType; typedef itk::Image ProjectionImageType; typedef typename ProjectionImageType::Pointer ProjectionImagePointer; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) /** The input is a stack of projections, we need to interpolate in one projection for efficiency during interpolation. Use of itk::ExtractImageFilter is not threadsafe in ThreadedGenerateData, this one is. The output can be multiplied by a constant. */ ProjectionImagePointer PublicGetProjection(const unsigned int iProj); /** Creates iProj index to index projection matrices with current inputs instead of the physical point to physical point projection matrix provided by Geometry */ ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj); protected: PublicBackProjectionImageFilter(); virtual ~PublicBackProjectionImageFilter() {} private: PublicBackProjectionImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace rtk #ifndef ITK_MANUAL_INSTANTIATION #include "rtkPublicBackProjectionImageFilter.txx" #endif #endif rtkPublicBackProjectionImageFilter.txx /*========================================================================= * * Copyright RTK Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __rtkPublicBackProjectionImageFilter_txx #define __rtkPublicBackProjectionImageFilter_txx #include "rtkPublicBackProjectionImageFilter.h" namespace rtk { //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} template typename PublicBackProjectionImageFilter::ProjectionImagePointer PublicBackProjectionImageFilter ::PublicGetProjection(const unsigned int iProj) { return this->GetProjection(iProj); } template typename PublicBackProjectionImageFilter::ProjectionMatrixType PublicBackProjectionImageFilter ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) { return this->GetIndexToIndexProjectionMatrix(iProj); } } // end namespace rtk #endif ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 30 12:06:57 2013 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 30 May 2013 18:06:57 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I?ve written a small filter deriving from rtk::BackProjectionImageFilter, > because I needed to access the protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I?m writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), which > call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message from the > linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o): In > function `rtk::PublicBackProjectionImageFilter, > itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It?s probably a stupid mistake, but I can?t find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType > InputPixelType; > > typedef typename TOutputImage::RegionType > OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > From Cyril.Mory at philips.com Fri May 31 05:14:06 2013 From: Cyril.Mory at philips.com (MORY, CYRIL) Date: Fri, 31 May 2013 09:14:06 +0000 Subject: [Rtk-users] Linker problem In-Reply-To: References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Hi Simon, Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. Regards, Cyril -----Message d'origine----- De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit Envoy? : jeudi 30 mai 2013 18:07 ? : MORY, CYRIL Cc : rtk-users at openrtk.org Objet : Re: [Rtk-users] Linker problem Hi Cyril, I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). Simon On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: > Hi, > > > > I've written a small filter deriving from > rtk::BackProjectionImageFilter, because I needed to access the > protected methods GetProjection() and > GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. > > The filter has only two additional methods, both public, called > PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), > which call their protected counterparts. > > The .h and .txx files are below. > > > > When creating this filter in my CUDA filter, I get an error message > from the linker : > > ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) > : In function `rtk::PublicBackProjectionImageFilter 3u>, itk::Image >::New()': > > /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: > undefined reference to > `rtk::PublicBackProjectionImageFilter, > itk::Image >::PublicBackProjectionImageFilter()' > > collect2: error: ld returned 1 exit status > > > > It's probably a stupid mistake, but I can't find it. Can someone help me ? > > > > rtkPublicBackProjectionImageFilter.h > > > > > > #ifndef __rtkPublicBackProjectionImageFilter_h > > #define __rtkPublicBackProjectionImageFilter_h > > > > #include "rtkBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > /** \class PublicBackProjectionImageFilter > > * \brief BackProjectionImageFilter where protected methods are made > public > > * > > * This filter exposes some of the methods that are protected in > BackProjectionImageFilter > > * Required for CudaProjectionStackToFourDImageFilter > > * > > * \author Cyril Mory > > * > > * \ingroup Projector > > */ > > template > > class ITK_EXPORT PublicBackProjectionImageFilter : > > public > rtk::BackProjectionImageFilter > > { > > public: > > /** Standard class typedefs. */ > > typedef PublicBackProjectionImageFilter Self; > > typedef itk::ImageToImageFilter > Superclass; > > typedef itk::SmartPointer Pointer; > > typedef itk::SmartPointer ConstPointer; > > typedef typename TInputImage::PixelType InputPixelType; > > typedef typename TOutputImage::RegionType OutputImageRegionType; > > > > typedef rtk::ProjectionGeometry > GeometryType; > > typedef typename GeometryType::Pointer > GeometryPointer; > > typedef typename GeometryType::MatrixType > ProjectionMatrixType; > > typedef itk::Image > ProjectionImageType; > > typedef typename ProjectionImageType::Pointer > ProjectionImagePointer; > > > > /** Method for creation through the object factory. */ > > itkNewMacro(Self) > > > > /** Run-time type information (and related methods). */ > > itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) > > > > /** The input is a stack of projections, we need to interpolate in one > projection > > for efficiency during interpolation. Use of itk::ExtractImageFilter is > > not threadsafe in ThreadedGenerateData, this one is. The output can be > multiplied by a constant. */ > > ProjectionImagePointer PublicGetProjection(const unsigned int iProj); > > > > /** Creates iProj index to index projection matrices with current inputs > > instead of the physical point to physical point projection matrix > provided by Geometry */ > > ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const > unsigned int iProj); > > protected: > > PublicBackProjectionImageFilter(); > > virtual ~PublicBackProjectionImageFilter() {} > > > > private: > > PublicBackProjectionImageFilter(const Self&); //purposely not > implemented > > void operator=(const Self&); //purposely not implemented > > > > }; > > > > } // end namespace rtk > > > > #ifndef ITK_MANUAL_INSTANTIATION > > #include "rtkPublicBackProjectionImageFilter.txx" > > #endif > > > > #endif > > > > > > > > rtkPublicBackProjectionImageFilter.txx > > > > /*========================================================================= > > * > > * Copyright RTK Consortium > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > * You may obtain a copy of the License at > > * > > * http://www.apache.org/licenses/LICENSE-2.0.txt > > * > > * Unless required by applicable law or agreed to in writing, software > > * distributed under the License is distributed on an "AS IS" BASIS, > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > > * See the License for the specific language governing permissions and > > * limitations under the License. > > * > > *=========================================================================*/ > > > > #ifndef __rtkPublicBackProjectionImageFilter_txx > > #define __rtkPublicBackProjectionImageFilter_txx > > > > #include "rtkPublicBackProjectionImageFilter.h" > > > > namespace rtk > > { > > > > //template > > //PublicBackProjectionImageFilter > > //::PublicBackProjectionImageFilter() > > //{ > > //} > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionImagePointer > > PublicBackProjectionImageFilter > > ::PublicGetProjection(const unsigned int iProj) > > { > > return this->GetProjection(iProj); > > } > > > > template > > typename > PublicBackProjectionImageFilter::ProjectionMatrixType > > PublicBackProjectionImageFilter > > ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) > > { > > return this->GetIndexToIndexProjectionMatrix(iProj); > > } > > > > } // end namespace rtk > > > > #endif > > > ________________________________ > The information contained in this message may be confidential and legally > protected under applicable law. The message is intended solely for the > addressee(s). If you are not the intended recipient, you are hereby notified > that any use, forwarding, dissemination, or reproduction of this message is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender by return e-mail and destroy all copies > of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users > ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From julien.jomier at kitware.com Fri May 31 06:02:09 2013 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 31 May 2013 12:02:09 +0200 Subject: [Rtk-users] Linker problem In-Reply-To: <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> References: <3B67D2F1029933428E0E93E2C2F1801334F981F6@011-DB3MPN1-041.MGDPHG.emi.philips.com> <3B67D2F1029933428E0E93E2C2F1801334F9826E@011-DB3MPN1-041.MGDPHG.emi.philips.com> Message-ID: <51A87521.9040708@kitware.com> Cyril, You are missing the constructor definition and you should probably uncomment these lines: //template //PublicBackProjectionImageFilter //::PublicBackProjectionImageFilter() //{ //} Julien On 31/05/2013 11:14, MORY, CYRIL wrote: > Hi Simon, > > Thanks for your answer. I think what I did is allowed in C++ (if I'm wrong, please correct me) : I have defined a daughter class with public methods that call protected methods of the mother class. I think it wouldn't be allowed, indeed, to change the private/protected/public type of a method, but that's not what I did. Just to check, I have tried to modify the two methods of the daughter class, removing the internal calls to the GetProjection() and GetIndexToIndexProjectionMatrix(). The linker error remains the same. > > I have the feeling it must be something obvious, but I can't find it. And I'd prefer not to copy-paste the code of these two functions. I'd give it another try today, and if it keeps not working I'll revert to the solution you propose. > > Regards, > Cyril > > -----Message d'origine----- > De : simon.rit at gmail.com [mailto:simon.rit at gmail.com] De la part de Simon Rit > Envoy? : jeudi 30 mai 2013 18:07 > ? : MORY, CYRIL > Cc : rtk-users at openrtk.org > Objet : Re: [Rtk-users] Linker problem > > Hi Cyril, > I don't think it is allowed in C++ to change the private/protected/public type of a method in daughter classes. > Otherwise, it would screw up the purpose of it. If your filter is not a BackProjection and you don't want to inherit from it, I would advise you to copy paste the GetIndexToIndexMatrix in your class. There are a few things there that depends on some class members so you will have to simplify it for your case (or have the same members in your class). > Simon > > > On Thu, May 30, 2013 at 5:48 PM, MORY, CYRIL wrote: >> Hi, >> >> >> >> I've written a small filter deriving from >> rtk::BackProjectionImageFilter, because I needed to access the >> protected methods GetProjection() and >> GetIndexToIndexProjectionMatrix() for a CUDA filter I'm writing. >> >> The filter has only two additional methods, both public, called >> PublicGetProjection() and PublicGetIndexToIndexProjectionMatrix(), >> which call their protected counterparts. >> >> The .h and .txx files are below. >> >> >> >> When creating this filter in my CUDA filter, I get an error message >> from the linker : >> >> ../../bin/librtkcuda.a(rtkCudaProjectionStackToFourDImageFilter.cxx.o) >> : In function `rtk::PublicBackProjectionImageFilter> 3u>, itk::Image >::New()': >> >> /home/cyril/sources/rtk/RTK/code/rtkPublicBackProjectionImageFilter.h:57: >> undefined reference to >> `rtk::PublicBackProjectionImageFilter, >> itk::Image >::PublicBackProjectionImageFilter()' >> >> collect2: error: ld returned 1 exit status >> >> >> >> It's probably a stupid mistake, but I can't find it. Can someone help me ? >> >> >> >> rtkPublicBackProjectionImageFilter.h >> >> >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_h >> >> #define __rtkPublicBackProjectionImageFilter_h >> >> >> >> #include "rtkBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> /** \class PublicBackProjectionImageFilter >> >> * \brief BackProjectionImageFilter where protected methods are made >> public >> >> * >> >> * This filter exposes some of the methods that are protected in >> BackProjectionImageFilter >> >> * Required for CudaProjectionStackToFourDImageFilter >> >> * >> >> * \author Cyril Mory >> >> * >> >> * \ingroup Projector >> >> */ >> >> template >> >> class ITK_EXPORT PublicBackProjectionImageFilter : >> >> public >> rtk::BackProjectionImageFilter >> >> { >> >> public: >> >> /** Standard class typedefs. */ >> >> typedef PublicBackProjectionImageFilter Self; >> >> typedef itk::ImageToImageFilter >> Superclass; >> >> typedef itk::SmartPointer Pointer; >> >> typedef itk::SmartPointer ConstPointer; >> >> typedef typename TInputImage::PixelType InputPixelType; >> >> typedef typename TOutputImage::RegionType OutputImageRegionType; >> >> >> >> typedef rtk::ProjectionGeometry >> GeometryType; >> >> typedef typename GeometryType::Pointer >> GeometryPointer; >> >> typedef typename GeometryType::MatrixType >> ProjectionMatrixType; >> >> typedef itk::Image >> ProjectionImageType; >> >> typedef typename ProjectionImageType::Pointer >> ProjectionImagePointer; >> >> >> >> /** Method for creation through the object factory. */ >> >> itkNewMacro(Self) >> >> >> >> /** Run-time type information (and related methods). */ >> >> itkTypeMacro(PublicBackProjectionImageFilter, BackProjectionImageFilter) >> >> >> >> /** The input is a stack of projections, we need to interpolate in one >> projection >> >> for efficiency during interpolation. Use of itk::ExtractImageFilter is >> >> not threadsafe in ThreadedGenerateData, this one is. The output can be >> multiplied by a constant. */ >> >> ProjectionImagePointer PublicGetProjection(const unsigned int iProj); >> >> >> >> /** Creates iProj index to index projection matrices with current inputs >> >> instead of the physical point to physical point projection matrix >> provided by Geometry */ >> >> ProjectionMatrixType PublicGetIndexToIndexProjectionMatrix(const >> unsigned int iProj); >> >> protected: >> >> PublicBackProjectionImageFilter(); >> >> virtual ~PublicBackProjectionImageFilter() {} >> >> >> >> private: >> >> PublicBackProjectionImageFilter(const Self&); //purposely not >> implemented >> >> void operator=(const Self&); //purposely not implemented >> >> >> >> }; >> >> >> >> } // end namespace rtk >> >> >> >> #ifndef ITK_MANUAL_INSTANTIATION >> >> #include "rtkPublicBackProjectionImageFilter.txx" >> >> #endif >> >> >> >> #endif >> >> >> >> >> >> >> >> rtkPublicBackProjectionImageFilter.txx >> >> >> >> /*========================================================================= >> >> * >> >> * Copyright RTK Consortium >> >> * >> >> * Licensed under the Apache License, Version 2.0 (the "License"); >> >> * you may not use this file except in compliance with the License. >> >> * You may obtain a copy of the License at >> >> * >> >> * http://www.apache.org/licenses/LICENSE-2.0.txt >> >> * >> >> * Unless required by applicable law or agreed to in writing, software >> >> * distributed under the License is distributed on an "AS IS" BASIS, >> >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >> >> * See the License for the specific language governing permissions and >> >> * limitations under the License. >> >> * >> >> *=========================================================================*/ >> >> >> >> #ifndef __rtkPublicBackProjectionImageFilter_txx >> >> #define __rtkPublicBackProjectionImageFilter_txx >> >> >> >> #include "rtkPublicBackProjectionImageFilter.h" >> >> >> >> namespace rtk >> >> { >> >> >> >> //template >> >> //PublicBackProjectionImageFilter >> >> //::PublicBackProjectionImageFilter() >> >> //{ >> >> //} >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionImagePointer >> >> PublicBackProjectionImageFilter >> >> ::PublicGetProjection(const unsigned int iProj) >> >> { >> >> return this->GetProjection(iProj); >> >> } >> >> >> >> template >> >> typename >> PublicBackProjectionImageFilter::ProjectionMatrixType >> >> PublicBackProjectionImageFilter >> >> ::PublicGetIndexToIndexProjectionMatrix(const unsigned int iProj) >> >> { >> >> return this->GetIndexToIndexProjectionMatrix(iProj); >> >> } >> >> >> >> } // end namespace rtk >> >> >> >> #endif >> >> >> ________________________________ >> The information contained in this message may be confidential and legally >> protected under applicable law. The message is intended solely for the >> addressee(s). If you are not the intended recipient, you are hereby notified >> that any use, forwarding, dissemination, or reproduction of this message is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender by return e-mail and destroy all copies >> of the original message. >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at openrtk.org >> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >> > > ________________________________ > The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at openrtk.org > http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >