Skip to content

zhongcanxiao/compress-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background removal benchmark

Introduction

This repo contains the python code implementing two machine learning based background removal algorithms:

  • KDTree based background estimation
  • Radial feature extraction

Included files are:

  • PYmodule/: the code implementing the background removal algorithms
  • script/: the code generating the data to be processed by the background removal algorithms (numpy array)
  • demo.ipynb: demonstration of the data processing workflow
  • plot.ipynb: figures for data illustration without need for interactive widget support

Installation

This code needs Python version 3.12.

Required modules can be installed with the following conda environment file.

conda create -n environment.yml

Example run with ipython notebook

  1. Open script/1-gen_sim_peak.ipynb and follow the cells to generate simulated file.
  2. Use demo.ipynb to perform the example material analysis.
  • Generating the npy files takes about 10min
  • Background removal with KD Tree methods takes ~ 1h
  1. Use plot.ipynb to visualize the results.

class on the Data matrix

  1. relevant methods of KDTree background removal:
  • apply_mask(): set Data elements that are masked to 0

  • build: calls node.create_children, assign splitted Data region to node,

  • estimate(): calls node.estimate: set node.data (assigned elements) to mean

  • random_select_subtract(data3d): set data3d to subtracted results

  • constant_subtract(data3d)

  • load

  • save

  1. relevant data of tree:
  • tree.tensor/node.data
  • tree.mask

TODO

‣潣灭敲獳搭瑡੡

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published