10 Remove X-ray and Unstack

Due to X-ray, a few pixels may have very high number. These pixels should be replaced by reasonable value, usually a local mean. We call this process "remove x-ray". This process is very simple with IMOD package. One only needs to run pre-process step from etomo interface.

One might need to unstack the X-ray removed stack into multiple single images to pick particles. IMOD has a standalone command "newstack" that unstacks an image, but itself doesn't automatically unstack all the images(sections) in a stack file at once. Fortunately, this can be done easily using a script like this example as below:

Example 1. unstack.sh


for file in $1 ;

		root=`basename ${file} .st`
		num_file=`header ${file} | grep sections | awk '{printf ($9)}'`
		for (( i=1; i<=${num_file}; i++ ))
			 f=`expr $i - 1`
			 index=`echo $f | awk '{printf("%03d",$1)}'`
			 ## for simple number index
			 #newstack -secs ${f} ${file} ${root}.${f}.mrc 
			 ## for 3 digit index, like 001,002
			 newstack -secs ${f} ${file} ${root}_${index}.mrc 

Run script like this:

 % ./unstack.sh [yourinputstack.st]