eXTReMe Tracker
Sep 302012
 

There is a compose functionality out there:

Linux umlaut typing

For the Gnome Desktop:

  • go to System -> Preferences -> Hardware -> Keyboard on the Gnome menu
  • select the Layouts tab
  • click the Options… button
  • expand Compose key position
  • check the box Right Ctrl is Compose or Right Win-key is Compose

The Right Ctrl or the Right Win key are now a “compose key”. With it you can compose symbols by combining two characters. The double-quote then the letter “a” equals an umlaut-a (ä). Tap the compose key, then tap shift+quote for a double-quote, then tap the a-key.

  • ä is compose, then “, then a
  • ö is compose, then “, then o
  • ü is compose, then “, then u
  • ß is compose, then s, then s

The list of compose key sequences can be found at:

Compose key sequences

Content found at blog: http://idolinux.blogspot.com/

Kül

 

Sep 192012
 
Simple image compression algorithm using plain FFT computation

FFT2 based image compression

Test code to generate a circular mask that removes the low frequency components from an image.

Step through radius to get the percentage compression.

IM=imread('images_01.jpg');IM=IM(:,:,2); %Select a channel
%
cx=size(IM,2)/2; cy=size(IM,1)/2;
ix=size(IM,2);iy=size(IM,1);r=833;
[x,y]=meshgrid(-(cx-1):(ix-cx),-(cy-1):(iy-cy));
c_mask=((x.^2+y.^2)>r^2);
%
filtIM = fft2(IM).*c_mask;
filtIM = ifft2(filtIM);
IM2=abs(double(IM)-abs(filtIM));
%
x=size(IM,1)*size(IM,2); y=size(find(c_mask==1)); y=y(1);
res=y/x*100;
%
figure(1); 
subplot(2,2,1); imshow(c_mask);
subplot(2,2,2); imagesc(IM2); axis image; axis off;
subplot(2,2,3); imshow(IM); title('Origianl image');
subplot(2,2,4); imagesc(abs(filtIM)); axis image; axis off;
title(sprintf('Percent original: %0.2f',res));
Sep 102012
 

Submitting processing job to a queue

jobs=$scratch/jobs
sub=/lustre/scratch/subjects
# mkdir $jobs
# cp -r $HOME/subjects $scratch/
function run-recon-all() {
cd $scratch
#create submit script for each patient in the subjects directory
do
unset SUBJECTS_DIR
SUBJECTS_DIR=$sub
export SUBJECTS_DIR
cat > $jobs/recon-all-$patient.sh <<EOF
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
#$ -N recon-all-$patient
# Set the hard and soft run time limits
#$ -l h_rt=30:00:00,s_rt=29:55:00,vf=2.5G
# set up FreeSurfer environment variables
# mri_convert -oi -os $SUBJECTS_DIR/$patient $SUBJECTS_DIR/$patient.mgz
recon-all -s $patient -all
EOF
done
#submit job script for each patient in the jobs directory to the cluster
pushd $jobs
for script in `ls -1`
do
echo "submitting job $script"
qsub $script
done
popd
}
run-recon-all