tkkarjal / magia Goto Github PK
View Code? Open in Web Editor NEWAutomated brain PET analysis pipeline
Home Page: https://doi.org/10.3389/fninf.2020.00003
License: MIT License
Automated brain PET analysis pipeline
Home Page: https://doi.org/10.3389/fninf.2020.00003
License: MIT License
If MRI is available, make sure the ROIs only include grey matter (using the c1 file). Now for example thalamus can be very bad, and the average grey matter density within thalamus may be less than 0.5.
Currently in aivo_get_info and aivo_set_info the table names are listed in the code. Maintaining the code in synchrony with the evolving structure of Aivo would benefit from automatic reading of the table names.
https://stackoverflow.com/questions/2276644/list-all-tables-in-postgresql-information-schema
A problem encountered running normwrite_df.
I think there might some issue with the path here.
I try to attach a screenshot of my top 15 folders in the path.
Can you generate default options for fur ftha?
start time 10
end time 20
Thanks
Using [11C]raclopride data I noticed that the process of warping the standardized radioactivity template to an individual's mean-PET image is highly unstable. Two Magia-runs with identical settings can lead to dramatically different BP estimates (e.g. in putamen 4 vs. 1). On the other hand the warpings from the individual to the template work much more reliably.
The process needs to be changed. If PET-based spatial normalization is used, then the ROIs should not be warped from the MNI space to the individual space. Instead, the individual PET images should be warped to MNI space.
Line 600 of magia_processor:
smooth_img(normalized_images(2:end),specs.magia.fwhm_post);
in results at this point there is only an image swrpet_id_suv.nii and
normalized_images(2:end) return empty variable.
Please fix this last bit, so that suv can work again.
Currently Magia can read the raw PET files in dcm, ecat or nifti format, and the MR images in dcm format. However, ecat is no longer used at least in Turku, so it would make sense to no longer support that option. While the raw image files are these days stored in dicom format, sometimes the study consists of several parts, and Magia cannot handle these cases. For example, in a recent FDG study there was a brain scan starting from an injection, and also a late scan 80-100 minutes after injection. For such cases, it would make a lot of sense to use all of these data in Patlak analyses, but Magia currently cannot handle that.
Another source of confusion is that sometimes the dicoms have not been decay-corrected to injection time, but the nifti has been corrected. It is possible that in such cases the user can misspecify the dc option in Magia, which may cause Magia to either double-correct for decay or not correct for it all. Having only one input image (the nifti) available would make this complication disappear.
Dropping support for dicoms would mean that the user would have to do the dcm2nii-conversion and the possible decay-corrections prior to magia analysis. However, that would not be too many lines of code in a script. Forcing the user to do the dcm2nii-conversion would also make visual quality control of the raw images more likely.
Many other pipelines only use niftis (e.g. fmriprep), and the change would not actually be that radical.
Of course relying only on niftis would also save disk space, as the dicoms could be deleted.
How can I determine the ref_region.codes for the below function? Thank you!
function ref_region = magia_get_ref_region(tracer)
switch tracer
case {'[11c]carfentanil' '[18f]dopa'}
ref_region.label = 'OC';
ref_region.codes = [1011 2011];
case {'[11c]raclopride','[11c]madam','[18f]spa-rq','[11c]pib','[11c]pbr28','[18f]cft','[11c]flb','[18f]fdg','[18f]mk6240','[18f]av45','[18f]fbb','[18f]av1451'}
ref_region.label = 'CER';
ref_region.codes = [8 47];
case {'[11c]pk11195' '[11c]tmsx'}
ref_region.label = 'CAU';
ref_region.codes = [11 50];
case {'[18f]fmpep-d2' '[18f]sv2a'}
ref_region.label = 'WM';
ref_region.codes = [2 41];
otherwise
ref_region = '';
end
end
To write freesufed = -1
Please consider whether it would be useful to save the ROI volumes with the output time activity curves. This would mean the ROIs could be later merged into a larger ROI, which is helpful when different analyses are planned. Then an option to save the TACs from all of the atlas ROIs could be chosen for flexibility down the road.
Relatedly, I am working on an R package for tac analysis (that calculates such weighted average TACs) and have added support for the magia tac output .mat file (https://github.com/eebrown/PET/tree/devel).
Hi, maybe get_frames_dcm should be in the magia repository.
I was trying to branching out to edit line 7
gunzip -fr
instead of
gunzip -r
with 'f' it forces the overwrite otherwise you have to manually say 'y' to each overwrite.
if you have gunzip -r somewhere else you should think about changing the other instances too ;)
This is probably due to error log file existing even if the recon-all produced the aparc+aseg file.
The current version of magia is very dependent on metadata stored in AIVO. This limits magia's distribution to other centers. The dependencies to AIVO should be removed.
Magia run halts when running with 'suv' model and is using magia_suv_image function
Possibility to join glucose and fatty acid as tracee in a single column to pick values from AIVO2.
Possibility to rename GU and FU parametric images to TU tracee uptake images, or read label from a list, or according to tracer specific naming. If fdg > GU, if FTHA > FU and so on. not so many tracers.
The formula for FU calculation is : FUR x Plasma FFA (the tracee value)
400: e1b0f00e movs pc, lr
On the actual hardware, when the "movs pc, lr" instruction is executed in SVC mode, even if an IRQ interrupt is triggered, the next instruction will be executed in USR mode. However, in the "magia" environment, the next instruction will be executed in IRQ mode instead.
hello,
I wrote a 100% matlab ecat2nii (which I will share of course :-)) and wanted to compare with your code
in convert_ecat2nii on line 9 you call the cmd imgflip and then on line 13 ecat2nii ; where did you get those binaries from? (is that in pet surfer?) - so I can compare with my conversion
thx
Hi all,
For technical reasons we are using only magia_logan_image.m
function, mainly because we use reference region instead of blood sampling as the input function.
We also use Ecat HR+ with fbp reconstruction, which leads to a lot of negative values and NANs in first frames.
In magia_logan_image.m
function, you apply a mask filtering the negative, 0s and NANs, which is too strict for us, removing almost all image. Unfortunately we can't share the images for confidentiality.
For us, we see two solutions:
t*
, but it will reduce the values of your Y
variable, we guess it should not affect Vt
but will reduce interceptmagia_fit_logan.m
directly, applying only our pre-calculated brain mask.Could you suggest the best way to proceed, please?
Thanks,
Soodeh
An explicit example of the proper data structure (as well as the environmental variables) would be useful
For example, in branch # 5 the PET image is first spatially normalised, and only after that are the parametric images calculated. Reversing the order would
Thanks very much for open-sourcing your pipeline. I have got it to run on my system by changing the hardcoded paths in the scripts, and hope to compare the results to my current pipeline.
I thought I would suggest that you may be able to increase the processing speed of the pipeline by adding -parallel
to the recon-all command. This defaults to allowing 4 cores for OpenMP, and cores can be further specified by using -parallel -openmp n
where n is the number of cores (see https://surfer.nmr.mgh.harvard.edu/fswiki/ReleaseNotes). It helped a lot on my system.
The function magia_read_specs(specs_file)
in magia_read_specs.m
stores numeric values from the text file as char. This causes problems, such as '0'
being evaluated as true, where 0
should be false, e.g. in magia_processor.m
. I think the frames are also loaded as char
and not converted to the expected format.
Run_magia will not finish if model = 'suv'. I will comment this out for the time being
Magia currently assumes that the input files are either dcm, nii, or ecat format. Magia uses Vesa's software to handle some things with ECATs. However, the most recent files are never in ECAT format. The ECAT files should be converted into nifti format. After this Vesa's software would no longer be needed, making installation of magia easier.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.