|
From: Marc C. <mch...@ph...> - 2012-01-26 17:26:23
|
Hi Meg!
I've never added a scanner myself, but here is how you would add a cylindrical PET system. Please, someone correct me if I'm wrong.
To add a scanner, you need to edit two files: scanner.h (found in the STIR/include/ directory) and scanner.cxx (found in the STIR/buildblock/ directory).
In scanner.h, on line 119 (at least, in my version of the file), there is the following:
enum Type {E931, E951, E953, E921, E925, E961, E962, E966,E1080,RPT,HiDAC, Advance, DiscoveryLS, DiscoveryST, DiscoverySTE, DiscoveryRX, Discovery600, HZLR, RATPET,HRRT, Allegro, User_defined_scanner, Unknown_scanner};
This is the list of all available scanners in STIR.
Now, open scanner.cxx and look at a sample scanner, for example the Advance scanner. You will find the following lines of code (I've put each number on its own line to make it easier to understand later):
case Advance:
// 283 bins (non-uniform sampling)
// 281 bins (uniform sampling)
/* crystal size 4x8x30*/
set_params(Advance, string_list("GE Advance", "Advance"),
18,
283,
281,
2 * 336,
471.875F - 8.4F,
8.4F,
8.5F,
1.970177F,
0.0F, //TODO view offset shouldn't be zero
3,
2,
6,
6,
1,
1,
1);
break;
So this code is describing the Advance scanner by calling the set_params() method with all the values up there. If you want to know what each of these values represent, look at the scanner.h file again and look for the set_params() method. You will find the following:
// ! set all parameters, case where default_num_arccorrected_bins==max_num_non_arccorrected_bins
void set_params(Type type_v, const list<string>& list_of_names_v,
int num_rings_v,
int max_num_non_arccorrected_bins_v,
int num_detectors_per_ring_v,
float inner_ring_radius_v,
float average_depth_of_interaction_v,
float ring_spacing_v,
float bin_size_v, float intrinsic_tilt_v,
int num_axial_blocks_per_bucket_v, int num_transaxial_blocks_per_bucket_v,
int num_axial_crystals_per_block_v, int num_transaxial_crystals_per_block_v,
int num_axial_crystals_per_singles_unit_v,
int num_transaxial_crystals_per_singles_unit_v,
int num_detector_layers_v);
// ! set all parameters
void set_params(Type type_v, const list<string>& list_of_names_v,
int num_rings_v,
int max_num_non_arccorrected_bins_v,
int default_num_arccorrected_bins_v,
int num_detectors_per_ring_v,
float inner_ring_radius_v,
float average_depth_of_interaction_v,
float ring_spacing_v,
float bin_size_v, float intrinsic_tilt_v,
int num_axial_blocks_per_bucket_v, int num_transaxial_blocks_per_bucket_v,
int num_axial_crystals_per_block_v, int num_transaxial_crystals_per_block_v,
int num_axial_crystals_per_singles_unit_v,
int num_transaxial_crystals_per_singles_unit_v,
int num_detector_layers_v);
So it's telling you that the first value in set_params() is the type of scanner. In this case, "Advance", because "Advance" was the word used in the list of scanners in scanner.h. Then, it tells you to specify a list_of_names. So, for the Advance scanner, the list of names is "GE Advance" or simply "Advance". Then you need to specify all of the characteristics of the scanners, namely: the number of rings, the number of bins, etc. In the case of the Advance scanner, you have:
num_rings_v = 18
max_num_non_arccorrected_bins_v = 283
default_num_arccorrected_bins_v = 281
etc.
If you are wondering what some of these variable names mean, just look them in scanner.h. In addition, the file scanner.h also has description of the terms "bucket", "block", and "singles unit". You can also see this thread from the mailing list: http://sourceforge.net/mailarchive/message.php?msg_id=25405007
Looking at this example from the "Advance" scanner, you should be able to figure out how to add your own scanner.
First, notice that in the enum() list in scanner.h, there is a scanner named "User_defined_scanner". You can use that scanner as your template. If you want to, change its name in that list. Don't forget to save any changes you make to scanner.h
Now, look for "User_defined_scanner" in the file scanner.cxx. You will find the following:
case User_defined_scanner: // zlong, 08-04-2004, Userdefined support
set_params(User_defined_scanner, string_list("Userdefined"),
0,
0,
0,
0.F,
0.F,
0.F,
0.F,
0.F,
0,
0,
0,
0,
0,
0,
0);
break;
Change the name "User_defined_scanner" to whatever name you picked for your scanner and simply fill in the appropriate numbers on each line. Save the file. Now, you just need to recompile STIR. You may want to test your scanner: refer to the mailing list thread that I linked to earlier.
Now, all of this is tailored for a cylindrical PET system, but it should give you a good starting point.
I hope this makes sense!
Marc
__________________________
Marc Chamberland, MSc
PhD candidate
Department of Physics
Carleton University
Ottawa (ON)
Le 2012-01-26 à 10:08 AM, Kris Thielemans a écrit :
> Hi
>
> I'd like to make an appeal to the users here. This question has been asked
> and partly answered already a few times on this list. Could someone collate
> this info and reply accordingly? We can then put it on the Wiki as part of
> the FAQs.
>
> Of course Meg, you could search the list archive yourself (see instructions
> on the mailing list page of the stir web site) and report back.
>
> Thanks
>
> Kris
>
>> -----Original Message-----
>> From: sti...@li... [mailto:stir-users-
>> bo...@li...] On Behalf Of MALGORZATA ZOFIA PAJAK
>> Sent: 26 January 2012 13:23
>> To: sti...@li...
>> Subject: [Stir-users] how to add new scanner?
>>
>> Hi All,
>>
>> I'm brand new user of STIR. I know it might be considered rather a basic
>> question, but how do I add new scanner? I know it supports only
> cylindrical
>> configuration at the moment. I work with octagonal small-animal scanner,
>> but wanted to try mapping it into cylindrical shape if it makes sense.
> Where
>> do I start? I will be grateful for any pointers.
>>
>>
>> Thanks in advance,
>> Meg
>> Stir-users mailing list
>> Sti...@li...
>> https://lists.sourceforge.net/lists/listinfo/stir-users
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Stir-users mailing list
> Sti...@li...
> https://lists.sourceforge.net/lists/listinfo/stir-users
|