2D EMC pedagogical model.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EMC.c
README.txt
contrast.dat
make_data.c
runEMC.py

README.txt

This package was written by N. Duane Loh.
Last update  Thu Jun 12 2014.

Package function:
	Simulates data and reconstructions of a simplified version of cryptotomography. 

===========================================================================================================================
Included in this package:
	make_data.c
	EMC.c
	runEMC.py
	contrast.dat

===========================================================================================================================
Dependencies of this package:
	to compile the C files: 
		gcc, standard C libraries (stdio, stdlib, time, math)  
	to run Python file: 
		python2.7 with matplotlib, numpy, scipy installed.
		The functions here that use dictionaries are incompatible with Python3.
	Note to Windows users:
		You might want to download Enthought's python distribution (free for academic use). 
		Then figure out how to compile C programs.

===========================================================================================================================
How to run this package:
	---------------------------------------------------------------------------------------------------------------------
	1. Pythonic+C  mode (recommended):
		(A) Run some default scenarios on the command-line. 
			Type into the command-line:
				./runEMC.py d 
				(If this fails check your python version in /usr/bin/env)

		(B) Run user-customized scenarios in an interactive ipython session.
			Type:
				In[##]: %run runEMC.py
			The variable emc will be initialized for you to run custom scenarios.
			
			To customize scenarios, consult the function runExample() in runEMC.py.
			Here are a few example scenarios.
				- Has background blanks but background model not employed in reconstruction.
					In[##]: emc.runExample(numPatterns=10000, numIter=200, sigLvl=20.,bgLvl=10., hitRate=0.4, hasBackground=False)
	
				- Previous scenario but now with background model employed in reconstruction.
					In[##]: emc.runExample(numPatterns=10000, numIter=200, sigLvl=20.,bgLvl=10., hitRate=0.4)
	
				- Good signal-to-background ratio but low hit rates. 
				Look at the text output when program terminates to see algorithm's estimate of actual hit rates.
					In[##]: emc.runExample(numPatterns=10000, numIter=200, sigLvl=20.,bgLvl=10., hitRate=0.1)
	
				- Poor signal-to-background ratio but high hit rates. 
					In[##]: emc.runExample(numPatterns=100000, numIter=200, sigLvl=10.,bgLvl=20., hitRate=0.9)
	
			Here are some convenience functions.
				- Clean up intermediates generated by example.
					In[##]: emc.deleteIntermediates()
	
				- Recompile the C binaries.
					In[##]: emc.recompile()
	
	---------------------------------------------------------------------------------------------------------------------
	2. C mode (Consult runEMC.py on how to send arguments to these C executables to run on the command-line.).
		(A) To compile look at the headers of the make_data.c and EMC.c files
			head -n20 make_data.c
			head -n27 EMC.c
		
		(B) Simple usage scenario on the command line:
			- Create 10000 images with avg. of 10 signal photons and 10 background photons. 
			Hit rate set to 50%. 
			Type into the command-line prompt:
				./make_data -s 10. -n 10. -d 10000 -h 0.5
			
			- Reconstruct with the above data, for 100 iterations, while simulatenously reconstructing a background model. 
			Type into the command-line prompt:
				./EMC -n 100 -b
				



===========================================================================================================================
How to cite work related to this package:
	Loh, N. D. A minimal view of single-particle imaging with X-ray lasers. Philosophical Transactions of the Royal Society B: Biological Sciences 369, 20130328–20130328 (2014).