Python模块,用于提取各种文件类型和格式的光生理roi和轨迹
segmentationextractors的Python项目详细描述
分段提取器
基于Python的模块,用于从多种文件格式中提取、转换和处理记录和光学成像数据。灵感来自SpikeExtractors。
入门:
安装(<;=python3.6):
pip install segmentationextractors
安装(>;=python3.7):
将需要手动安装包依赖项SIMA,因为它当前不支持python 3.7:
- 下载SIMA wheels发行版here。在
pip install <download-path-to-wheels.whl>
pip install segmentationextractors
用法:
当前支持的文件类型:
- calciumImagingAnalysis(CNMF-E,摘录)
- SIMA
- NWB
- Numpy(一种数据格式,用于将光学生理数据作为各种Numpy数据集手动输入)
功能:
各种数据格式之间的相互转换,以及转换为NWB格式和返回。在
特点:
- SegmentationExtractor对象:
seg_obj.get_channel_names()
: 光通道名称列表seg_obj.get_num_channels()
: 通道数seg_obj.get_movie_framesize()
: 原始电影的(高度、宽度)seg_obj.get_movie_location()
: 电影/tiff图像的存储位置seg_obj.get_image_masks(self, ROI_ids=None)
: 图像掩码为(ht、wd、num_rois),每个值作为分割操作期间给定的权重。在seg_obj.get_pixel_masks(ROI_ids=None)
: 获取像素掩码为(总像素(ht*wid),无\u ROI)seg_obj.get_traces(self, ROI_ids=None, start_frame=None, end_frame=None)
: df/F跟踪组件(num_rois,num_frames)seg_obj.get_sampling_frequency()
: df/F记录道采样频率。在seg_obj.get_roi_locations()
: ROI(感兴趣区域)的质心像素位置为(x,y)。在seg_obj.get_num_rois()
: 分段操作后的ROI总数。在seg_obj.get_roi_ids()
: 任何与ROI相关联的整数标记,默认为0:num_of_rois
SegmentationExtractor对象创建:
import segmentationextractors
seg_obj_cnmfe = segmentationextractors.CnmfeSegmentationExtractor('cnmfe_filename.mat') # cnmfe
seg_obj_extract = segmentationextractors.ExtractSegmentationExtractor('extract_filename.mat') # extract
seg_obj_sima = segmentationextractors.SimaSegmentationExtractor('sima_filename.sima') # SIMA
seg_obj_numpy = segmentationextractors.NumpySegmentationExtractor(
filepath = 'path-to-file',
masks=np.random.rand(movie_size[0],movie_size[1],no_rois),
signal=np.random.randn(num_rois,num_frames),
roi_idx=np.random.randint(no_rois,size=[1,no_rois]),
no_of_channels=None,
summary_image=None,
channel_names=['Blue']) # Numpy object
seg_obj_nwb = segmentationextractors.NwbSegmentationExtractor(
filepath_of_nwb, optical_channel_name=None, # optical channel to extract and store info from
imaging_plane_name=None, image_series_name=None, # imaging plane to extract and store data from
processing_module_name=None,
neuron_roi_response_series_name=None, # roi_response_series name to extract and store data from
background_roi_response_series_name=None) # nwb object
数据格式转换:SegmentationExtractor到NWB:
^{pr2}$示例数据集:
- 可以下载每种文件格式的示例数据集here。在
课程描述:
- 在
SegmentationExtractor:
在 - 在
一个抽象类,当应用于预处理的数据时,包含ROI分段操作的所有元数据和输出数据。它还包含从处理管道(如SIMA、CaImAn、Suite2p、CNNM-E)输出的各种数据格式的读写方法
在 - 在
NumpySegmentationExtractor:
在 - 在
构建NumpySegmentationExtractor对象的目的是包含来自当前不支持的文件格式的所有数据。要构造这个函数,所有数据都必须作为参数手动输入。在
在 - 在
CnmfeSegmentationExtractor:
在 - 在
这个类继承了SegmentationExtractor类,它的所有功能都专门应用于“CNMF-E”ROI分段方法的数据集输出。在
在 - 在
ExtractSegmentationExtractor:
在 - 在
这个类继承了SegmentationExtractor类,它的所有功能都专门应用于“EXTRACT”ROI分段方法的数据集输出。在
在 - 在
SimaSegmentationExtractor:
在 - 在
这个类继承了SegmentationExtractor类,它的所有功能都专门应用于“SIMA”ROI分段方法的数据集输出。在
在 - 在
nwbsegationExtractor:
在 - 在
类用于从NWB数据格式提取数据。还实现了一个静态方法来将任何格式特定的对象写入NWB。在
在
- 项目
标签: