Code Monkey home page Code Monkey logo

neuroimaging.jl's Introduction

Neuroimaging.jl

Documentation Tests Julia 1 codecov

Process neuroimaging data using the Julia language.

Documentation

See https://rob-luke.github.io/Neuroimaging.jl

Contributing

This package has been around since Julia v0.1! The Julia language has evolved since the early days, and there are many places in the codebase that should be brought up to date with the latest Julia standards. We are currently trying to revitalise this project, so if you have any feedback or suggestions please let us know. See CONTRIBUTING.md for details on how to get involved.

neuroimaging.jl's People

Contributors

behinger avatar codles avatar github-actions[bot] avatar gitter-badger avatar jonasbn avatar likanzhan avatar prcastro avatar rob-luke avatar staticfloat 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  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

neuroimaging.jl's Issues

Create annotation type

To replace triggers type. Annotations are more general and can be used to encode things beyond triggers, such as bad segments, blinks, etc

Add relevant SSR example dataset

Following #43 and #99. Need to find a relevant dataset for the SSR example (#35 ) or upload something myself. But all my data is 4GB so too big. And the MNE example data is .eeg format, which we don't support. So need to find a good example data

Use macros for logging

From Logging.jl

For the functions above, there is always a small overhead for the function call even when there is no log output. Logging.jl provides macros which work like the functions above, but which remove this overhead.

Rename package

I am thinking neuroimaging.jl as I will add support for MEG, fNIRS, etc

Add standard 3D brain and head visualisation

I remember seeing a head/brain visualisation on one of the plotting library demos, this can be a nice basis.

The data should be carefully selected as a standard head model from one of the well published sources with well described coordinates etc.

Tutorials/Examples

I really appreciate all the work you're doing on this. I'm currently deeply in neuroimaging research and trying to add EEG to my repertoire for my current lab. This package is looking very promising and I'm hoping to start using it in the coming months, but I personally would need some more tutorials and examples. Are there any currently available tutorials or notebooks available?

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

Add hierarchy for electrophysiology types

The type system could be made clearer.

Top level split in to

abstract EvokedPotential
abstract SpontaneousPotential

Then different categories defined

abstract SteadyStateResponse <: EvokedPotential
abstract TransientResponse <: EvokedPotential
abstract RestingState <: SpontaneousPotential

Finally specific types are specified

type AuditorySteadyStateResponse <: SteadyStateResponse
    # Definitions
end

type VisualSteadyStateResponse <: SteadyStateResponse
    # Definitions
end

type AuditoryBrainstemResponse <: TransientResponses
    # Definition
end

This would reduce complexity as

assr = AuditorySteadyStateResponse()
isa(assr, SteadyStateResponse)      # true
isa(assr, EvokedPotential)          # true

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Better check for uniqueness of dipoles

Currently on the size of the dipole is compared. Add check for x, y and z coordinates.

Make a function to compare distances. Eg

function same_location(a, b) = distance(a, b) == 0

Fix warnings thrown due to changes in data frames package

The tests are throwing the following warnings due to changes in the data frames dependency package. These need to be fixed as described in the warning.

┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.
│   caller = extract_epochs(data::Matrix{Float64}, triggers::Dict{String, AbstractArray}, valid_triggers::Vector{Int64}, remove_first::Int64, remove_last::Int64, trigger_offset::Int64) at epochs.jl:54
└ @ EEG ~/work/EEG.jl/EEG.jl/src/reshaping/epochs.jl:54

┌ Warning: `setindex!(df::DataFrame, v::AbstractVector, col_ind::ColumnIndex)` is deprecated, use `begin
│     df[!, col_ind] = v
│     df
│ end` instead.
│   caller = extract_epochs(data::Matrix{Float64}, triggers::Dict{String, AbstractArray}, valid_triggers::Vector{Int64}, remove_first::Int64, remove_last::Int64, trigger_offset::Int64) at epochs.jl:39
└ @ EEG ~/work/EEG.jl/EEG.jl/src/reshaping/epochs.jl:39

Specify channels to import

Obviously this is wack

a = read_SSR("test.bdf", channels = ["Cz", "P6"])
channelnames(a)

#2-element Array{AbstractString,1}:
# "Fp1"
# "AF7"

Remove lab specific code

There are aspects of the code base that are specific to my old lab setup. Please note these as comments below and we can systematically remove them and make things more general.

Read EDF file format

Very similar to BDF files, EDF is the standard format of biosignals for many EEG amplifiers, including the cheapest in the market: Emotiv Epoch, Emotiv Insight, and OpenBCI. Adding support to this format would allow a bigger community to use and support the project.
The description of the format can be found here, and an attempt at reading EDF from julia can be found here (although it seems like it's only some pasted python code)

From the google julia-users group I've found this code:

function load_edf(filename::String)

  header = Dict{ASCIIString,Any}()

  open(filename,"r") do fd
    version =  bytestring( read(fd, Uint8, 8) )
    header["version"] = version

    localPatientId =  bytestring( read(fd, Uint8, 80) )
    header["version"] = localPatientId

    ...

    # here the data would be read
  end
  return data, header
end

The conversation also points to @codles BDF.jl, but when trying to read an EDF with EEG.jl the following error appears:

WARNING:root:File type edf is unknown

I would love to help creating the functionality, but I'm still not very well acquainted with the library. If you can point me in the right direction I'll do my best to create it.

Ensure compatibility with latest version of all dependencies

Handy way to view which packages are out of date (in addition to CompatHelper)...

using Pkg

cd(joinpath(DEPOT_PATH[1], "registries", "General")) do
         deps = Pkg.dependencies()
         registry = Pkg.TOML.parse(read("Registry.toml", String))
         general_pkgs = registry["packages"]
    
         constrained = Dict{String, Tuple{VersionNumber,VersionNumber}}()
         for (uuid, dep) in deps
             suuid = string(uuid)
             dep.is_direct_dep || continue
             dep.version === nothing && continue
             haskey(general_pkgs, suuid) || continue
             pkg_meta = general_pkgs[suuid]
             pkg_path = joinpath(pkg_meta["path"], "Versions.toml")
             versions = Pkg.TOML.parse(read(pkg_path, String))
             newest = maximum(VersionNumber.(keys(versions)))
             if newest > dep.version
                 constrained[dep.name] = (dep.version, newest)
             end
         end
    
         return constrained
     end
end

From https://bkamins.github.io/julialang/2020/05/11/package-version-restrictions.html

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.