MNE read EEG channel location from EEGLAB set file - eeglab

I have imported a set file from EEGLAB using io.read_epochs_eeglab. I am now computing the channel connectivity matrix to perform a cluster permutation. Since for EEG data it is still not possible to use the template that corresponds to my net (GSN-HydroCel-128), I am using mne.find_ch_connectivity. What I am trying to understand is how the channel coordinates of the set file are interpreted by MNE. Is the order of X, Y and Z coordinates the same? And the unit of measure? I wonder if I should create a separate info with opportunely arranged coordinates or everything is correctly computed in an automatic way. Many thanks!

Related

Getting a random simple path between two nodes in a graph

Given the start node and goal node in a graph, I want to find one simple path between these two nodes. I do not want the shortest path, but need any random simple path.
I tried using all_simple_paths from networkx, but this module seems to calculate all the simple paths before returning anything. This takes a long time to run.
Is there a way to find just one simple path?
Also, I would ideally like to make sure this path does not cross any "obstacles". These obstacles are a predefined set of nodes from the same graph. Is there a way to add in this constraint?
PS: I don't necessarily need to use networkx. The code I am writing is in Python.
You could treat this as a min cost network flow problem where your start node wants to send a unit of flow (demand = -1) to your goal node (demand = 1). You can set the edge capacities to 1 and you can set all the edge weights to 0 except for those around "obstacle" nodes. For those obstacle nodes you can set all the edges either coming into or going out of them to have a weight of 1. The algorithm will try to find any arbitrary path using only edges with weight 0, but will use weight 1 edges if no path exists with only weight 0 edges.
See the nx.min_cost_flow function. This function requires you to make your graph a directed graph nx.DiGraph if it's not already.
I managed to solve this problem by using the RRT algorithm. It gives a random path between the source and destination nodes and also avoids obstacles.

Looking for Python module for graph visualization

I'm looking for a python 3 module that can generate a visual representation of a graph. Ideally I would give it a list of nodes and a list of connection, as well as some small amount of data associated with those things, and it would open a window (but an image saved on disk is fine) showing said nodes connected as specified. I don't want to specify the positions of the nodes, instead I'd like the software to arrange them in a way that minimizes edge crossings at least approximately.
Is there any such module? All I've been able to find are plotters and such...
If there is none, an easy-to-learn graphics module would do: I have never done any graphics things.
You can take a look at networkx. It offers the possibility to draw graphs with matplotlib

Importing Transient Data into Paraview

I have a 3D triangulated surface. Nodes and Conn variables store the coordinates and connectivity of the triangles. At each vertex, a scalar quantity, S, and a vector with three components, V, are stored. These data are time-dependent. Also, my geometry does not change over time and I have one surface for all the timesteps.
How should I approach for writing a VTK file that has the transient data over this surface? In other words, I want to write the value of S and V at different timestep on this 3D surface in a single VTK file. I ultimately want to import this VTK file into Paraview for visualization. vtkTemporalDataSet seems to be the solution for me but I could not find an example on how to write an ASCII or binary file for this VTK class. Could vtkPolyData somehow be used to define time so that Paraview knows the transient nature of my dataset? I would appreciate any help or comment.
The VTK file format does not support transient data. However, you can write a series of files that ParaView will interpret as a time sequence. This will work fine with poly data in the VTK file. The file series is defined as files of the same name with a number identifier in them. For example, if you have a series of files named:
MyFile_000.vtk
MyFile_001.vtk
MyFile_002.vtk
ParaView will group these files together in its file browser and when you read them together, it will treat them as a file sequence with 3 time steps.
The bad part of this representation is that you will have to replicate the Nodes and Conn in each file. If that is a problem, you will have to use a different file format that supports multiple time steps using the same connection information (such as the Exodus II file format).

Active frame extraction from motion capture

I am new to this area - I have a background in a Gait and Posture.
I have a series of motion files of timestamped coordinates (containing X, Y, and Z in mm) with a number of joints (30).
What would be the simplest way to extract the following from the motion observations. 1) The number of active features (i.e. active joints). 2) average speed of motion.
Same file is the format of NxP. Where P is the number of joints and N is the number of frame observations.
What I am looking for is some pointers into possible areas to explore.
Regards,
Dan
A couple of possibilities you might like to explore - both using completely free, (and open source), software:
Python + Numpy/SciPy can easily read in your
coordinate values and calculate the data you require - it is also
possible to plot in 3D using matplotlib.
You could use your positional data to animate a stick figure in
Blender - some of the test blends would provide a good starting point for this.

Recompute a 3d vector field in a set of isosurfaces

I working on program (fortran90), which computes an magnetic field of some static set of wires with electric current. Its output is a magnetic field vectors in many points as file with columns "x,y,z,v_x,v_y,v_z). I able to plot this with gnuplot, e.g.:
But now I want to rewrite program to output isosurfaces (surfaces at which modulus of magnetic field vector is constant), like this (it is found in internet and don't correspond to first image)
Can I do this as second program or with using utility, which will convert my file with 6 columns into ... something format which can be drawn as surface set. Another way of doing this, as I think, is to rewrite first program to compute isosurface directly. Please, recommend me which way is better and how actually I can do this.
I think MathGL can do it easily. It is cross-platform GPL plotting library which have Fortran interface too. Here you can use a sequential call of vector fields and isosurface plotting.

Resources