Giter Site home page Giter Site logo

tkkarjal / magia Goto Github PK

View Code? Open in Web Editor NEW
28.0 9.0 6.0 34.73 MB

Automated brain PET analysis pipeline

Home Page: https://doi.org/10.3389/fninf.2020.00003

License: MIT License

MATLAB 96.16% M 2.20% Objective-C 1.64%
positron-emission-tomography neuroinformatics magia brain

magia's People

Contributors

buccimtpc avatar eebrown avatar joupes avatar tkkarjal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magia's Issues

Improve ROI correction

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.

Important: PET-template-based spatial normalization ('old normalize') problem

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.

SUV model in the last version of magia

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.

Drop support for dcm and ecat files?

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 to creat a reference region myself?

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

Feature request: Save ROI volumes

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).

get_frames_dcm

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 ;)

Separate AIVO and MAGIA

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.

Add functionality to compute FU (Fatty acid uptake) images similarly to GU

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)

binaries?

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

A question about impicit masks in Logan fit

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:

  1. feed only frames after t*, but it will reduce the values of your Y variable, we guess it should not affect Vt but will reduce intercept
  2. Use magia_fit_logan.m directly, applying only our pre-calculated brain mask.

Could you suggest the best way to proceed, please?

Thanks,
Soodeh

Example of folder structure

An explicit example of the proper data structure (as well as the environmental variables) would be useful

Always calculate parametric images before spatial normalization

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

  1. Provide native space parametric images
  2. Speed up the process because in native space there are fewer voxels in which the modelling needs to be done

Speed up pipeline with multiple threads

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.

magia_read_specs.m saves numeric values as char

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.

Get rid of ECAT files

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.