Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
DHN-MED-Py is a wrapper library for Multiscale Electrophysiology Data Format developed by Matt Stead.
Python wrapper for MED format, GPL license 3.0. Commercial exceptions to GPL open source requirements may be negotiated with Dark Horse Neuro, Inc.
Multiscale Electrophysiology Data Format (MED) is an open source data format developed to manage big data in electrophysiology and facilitate data sharing.
The MED format is maintained by MEDFormat.org.
To install please use:
pip install dhn-med-py
Numpy is a required dependency.
#!/usr/bin/env python3
import dhn_med_py
from dhn_med_py import MedSession
# open session
sess = MedSession("/Users/JohnDoe/Desktop/MED-test/RawData.medd", "password")
print("First channel name:", sess.session_info['channels'][0]['metadata']['channel_name'])
sampling_rate = sess.session_info['channels'][0]['metadata']['sampling_frequency']
print("Sampling rate of first channel:", sampling_rate)
# read first minute of data, in 1 second chunks
for y in range(0, 60):
sess.read_by_index(sampling_rate * y, sampling_rate * (y+1))
print(sess.data['channels'][0]['data'])
# read first minute of data, in 1 second chunks
# negative time means relative to beginning of session
for y in range(0, 60):
sess.read_by_time(y * -1000000, (y+1) * -1000000)
print(sess.data['channels'][0]['data'])
# read matrix of first 1 minute of data.
# Return 5000 samples of data per channel (matrix has 5000 columns)
# antialiasing will be applied when downsampling (default filter setting is 'antialias')
sess.get_matrix_by_time(0, -60 * 1000000, sample_count=5000)
# print number of samples in each channel of the resulting matrix
print(sess.matrix['sample_count'])
# print the resulting matrix samples (2D Numpy array)
print (sess.matrix['samples'])
# read matrix of first 1 minute of data
# Return a sampling frequency of 3000 Hz.
sess.get_matrix_by_time(0, -60 * 1000000, 3000)
# print resulting matrix
print (sess.matrix['samples'])
# Read entire dataset, with output sampling set to 1000 Hz
sess.get_matrix_by_time('start', 'end', 1000)
# Read first 25000 samples, using the channel "5k_0001" as the reference channel
# This means the first 5 seconds of the session (for all channels) will be read.
# The default output number of samples corresponds to the highest channel
# sampling frequency.
sess.set_reference_channel("5k_0001")
sess.get_matrix_by_index(0, 25000)
# helper function to set detrending (baseline correction) for future matrix calls
sess.set_detrend(True)
# helper function to set trace_ranges. Matrix calls will return these
# as "minima" and "maxima" in the matrix result.
sess.set_trace_ranges(True)
# helper function to turn off filtering for future matrix calls
sess.set_filter("none")
# free session
del sess
FAQs
DHN-MED-Py is a wrapper library for Multiscale Electrophysiology Data Format developed by Matt Stead.
We found that dhn-med-py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.