Giter Site home page Giter Site logo

suspect's Introduction

suspect's People

Contributors

bennyrowland avatar danilomendesdias avatar darrencl avatar ihnorton avatar joeranbosma avatar josephmje avatar laurajanem avatar laurencejackson avatar mars20 avatar neurosutton avatar oscarjalnefjord avatar tstarr27 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

suspect's Issues

Bug in load_siemens_dicom

For some types of Siemens DICOM file the load_siemens_dicom() function fails to find the tag containing the CSA header and throws a KeyError

ENH: volume direction vectors

It would be nice to be able to access the individual direction vectors of an image volume, normalised, to make it easy to construct an aligned coordinate system for slicing other volumes, for example. It would be even better to be able to also ask for the axial/sagittal/coronal directions (or closest approximations) so that such slices can be constructed easily without reference to the original planes of the image.

ENH: singlet fitting should return a baseline parameter

Currently singlet fitting will return an FID with the best fit, but this does not incorporate any baseline estimation. As the first few points are not used in the fit as they are assumed to include baseline, this usually means that the fit and the data do not align very well. It would be better if the results included a baseline estimate as well, which could be derived by applying a spline smoothing to the difference between fit and data. Additional parameters should be added to the fit function controlling the smoothness and number of knots on this baseline.

ENH: Mask function for voxel on image

It should be possible to call a create_mask() function which produces a binary mask showing which voxels of a reference image are inside a spectroscopy voxel. In the default case this would be for all the voxels in the spectroscopy, but it should also be possible to specify a specific voxel or list of voxels to be used instead, so that masks for individual CSI voxels are also possible.

Import plots from Tarquin fitting

Currently processing data with Tarquin just returns the metabolite concentrations and SDs, but it would also be useful to have the various data plots available for display and saving.

Mac vs. Windows path name problems

The io functions require that the path names to the files are Mac-style (not Windows style). Let's put in some functionality to automatically detect this and work around it, instead of just barfing when it seeing a Windows-style path : )

Consistent version numbering

There should be a single source of the version number for the library, rather than having to keep multiple places in sync, such as sphinx conf.py and setuptools setup.py

ENH: improvements to channel combination

Channel combination is currently done with a rank-1 SVD algorithm. In some cases receiver channels have correlated noise and this should be whitened before the channel combination is performed. In addition, significant improvements in channel weighting estimation can be gained by apodisation of the FID signals to suppress the noise after the signal has died away, and for CSI data by performing some spatial blurring across voxels on the assumption that the sensitivities are spatially smooth compared to the voxel size.

ENH: to/from_scanner() should accept arrays of coords

Currently the to_scanner() and from_scanner() functions take three arguments: x, y, z and return an numpy array. It would be convenient if the functions could handle a numpy array as an input for consistency, this would also allow passing in an array of coords to be transformed all at once, for example from meshgrid(). On the other hand, in the case where the user wants to pass in simple known x, y and z values, this requires them to be wrapped in a tuple, being called like to_scanner((x, y, z)), similarly to the numpy.ones() function. This could be addressed by permitting either 1 or 3 *args and interpreting either as an ndarray of shape [...3] or 3 floats.

Get spatial information out of twix files

At the moment, only rda files load a transform to enable them to be co-registered to structural MRI images. It should in theory be possible to read this information out of the twix file as well.

Implement lcmodel fitting integration

Currently suspect knows how to submit data to the tarquin cli for fitting, and can write data in formats ready for lcmodel to process in the same way, but there is no automated way to perform the processing and read the results back into the Python interpreter.

Standardise fitting result return type

There are many fitting routines available from within Suspect, the built-in AMARES-style singlet fitting and integration with Tarquin and LCModel. It would be better if these different routines had more of a standardised interface, particularly with regard to returning the fitting result, so that they become more interchangeable.

DOC: Add a changelog

Add a changelog folder to the docs which will keep track of what changes have been incorporated into each release of the software.

TWIX Location Variables

Is there documentation for getting location variables form a TWIX file, I believe it is not in Suspect itself.

Add adjust_phase function

Add a function which can be passed an MRSData object and a zeroth (and optional first) order phase, and returns a new MRSData object which has had the phase shifts applied. This should also be callable with a method on the original MRSData object, by analogy with methods like np.ndarray.clip()

Convert docstrings to NumPy format

Conventional wisdom suggests that Python docstrings are easier to read in either NumPy or Google styles, rather than reStructuredText. Given the close relationship of this library with NumPy, it makes sense to choose that style for our docstrings.

ENH: auto-phasing

Add some algorithms for automatic phase estimation. Good first candidate is mag/real comparison, could also look at Ernst (minimise integral of imaginary component).

ENH: Add creatine fitting frequency correction

It should be possible to do frequency correction by specifying the expected frequency of a peak, finding the nearest peak to that frequency and moving the spectrum to align the peak to the frequency.

Spectrsocopy and Image

right now can the image module be used in some way to correlate MRS data instance with voxel locations? Sorry I am very new to dicom.

Slice spectrum

It should be possible to generate a slice object for a specified frequency range from an MRSSpectrum object, which can be used to extract specific regions of a spectrum (or set of spectra).

spectral_registration() doesn't handle frequency ranges correctly

The spectral_registration() function does not cope with having a limited frequency range set. If frequency limits are given then there is an error message, if a weight vector is given then the weights are not correctly applied and incorrect results are given.

ENH: image slice vectors should be positive

When getting axial/coronal/sagittal vectors from an image volume, they should always be predominantly aligned with the primary quadrant. This would mean that it is always possible to define a coordinate system of known orientation but aligned with the volume.

ENH: Resample image volumes

It should be possible to derive a new ImageBase from an existing ImageBase object by supplying the coordinate system, size and shape.

ENH: save and load to nifti format for images

Because we use a different coordinate convention from nifti files (DICOM standard), we should provide helper functions to load and save nifti files including making the transform in conventions.

Support n-d svd_weighting

The current svd_weighting code assumes that the input data is 2D, channels and ADC, but in some cases we might want to for example calculate the weights on repetitions x channels x ADC, which should be done by permuting the axes into the 2D shape channels x (repetitions x ADC) etc. This means svd_weighting() should support an optional axis parameter to define the axis of the provided ndarray which represents the channels.

ENH: adjust_frequency() function for MRSData

Currently frequency correction is applied with the transform_fid function in the processing module, but it would be logically better to put this in the MRSData class, by analogy with the existing adjust_phase() function.

BUG: some Siemens spectroscopy DICOM files are not loaded

Siemens DICOM files from VB17A (from Magnetom 7T) have a ProtocolSliceNumber parameters in the CSA header which is not handled by the load_siemens_dicom() function, leading to an error in import.

In addition, at this point there is probably no need to produce an error on an unrecognised CSA tag, as all essential tags are already being read in, all others are metadata at best and so if some are missing it shouldn't matter. Instead a warning could be raised which would allow users to report back if they find a new parameter to be missing, without it affecting their use of the software.

Trouble decoding and encoding twix VB format during anonymization

Hi,

I'm having some trouble with the anonymize_twix() function. My file is read as the VB format.

Decoding to windows-1252 produces the error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 418277: character maps to <undefined>

Decoding using latin-1 works (as shown in the load_twix_vb() function). However, I can't write the anonymized header to a new file. Using windows-1252, there is again an issue with the 0x8f character.

Twix loading confuses voxel size and fov size

At the moment, the twix loading code responsible for generating the data transform reads the field of view data and uses it as the size of a voxel. This works for single voxel data but not for CSI.

BUG: SIFT denoising always returns real

SIFT denoising can be used to denoise either real or complex data, but currently always returns the real part of the result. It would be better if it returned a result which matched the type of the original input data (internally the data always becomes complex due to the FT operation).

ENH: Support applying a transform to MRSBase

In cases where multiple spectroscopy exams are performed on the same subject, it is often necessary to register them to each other. This is usually done by registering co-acquired structural images together to get a transform between the patient position in each case, then that transform must also be applied to the spectroscopy data. Therefore it should be possible to apply a transform to an MRSBase object to update its internal transform to a new space. This will not affect the internal data, but will be relevant for resampling and superimposing on structural images.

BUG: Spectral registration initial guess is negated

In the spectral registration method the initial guess is used as the shift to map the FID onto the target, not the amount the FID has been shifted away, which is what is returned. When used iteratively, this means negating the shifts each time.

Spectra should be first class data objects

Currently MRSData objects contain FID data and provide various convenience methods and properties, while spectra are bare ndarrays without any additional information. It would be better if the two classes inherited from (let's say) MRSBase giving some core methods, and then provided their own methods on top of those. Calling .spectrum() on an MRSData would return an MRSSpectrum object and calling .fid() on an MRSSpectrum object would return an MRSData object. Then users can work with whichever domain they prefer, without having to go back and forth all the time.

Better loading of structural images

At the moment, loading dicom images through the image module is very clunky, returning multiple independent components on load and without any useful functions to make it easy to work with. This could be solved by creating an MRBase class as a superclass of MRSBase, representing a multi-dimensional array of data with a transform and to/from_scanner() functions. This could then be used for image data as well.

Convert .coord to .csv

There should be a helper script (similar to anonymise_twix) that will take a .coord file from lcmodel and convert it to a css file with the different plots as columns, for easy plotting in excel and other tools.

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.