eXTReMe Tracker
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));
Mar 052012
 

Here’s a quick chart I made for quick look-up for conversion between Celsius and Fahrenheit scale.

[°C] =  5/9 × ([°F] – 32)

A graphical lookup for conversion between Fahrenheit and Celsius

A graphical look-up for conversion between Fahrenheit and Celsius (click to view full size)

The bold marking are at multiples of 100 degree Celsius.

Apr 142011
 

Assuming the nifti toolbox is in Matlab path, we can get the 91x109x91 mask to have the same dimensions as the normalized images generated with bounding boxes.

If we are making a mask for hippocampus, first we save that mask from WFU Pickatlas. Then to make it 79x95x68 voxels, run the following small script.

x=load_untouch_nii(‘hipp.img’);
x=x.img;xdim=[1:6 86:91]; ydim=[1:6 102:109]; zdim=[1:11 80:91];
origin=[40 57 26]; datatype=16;
x(xdim,:,:)=[]; x(:,ydim,:)=[]; x(:,:,zdim)=[];
nii=make_nii(x, [2 2 2], origin, datatype);
save_nii(nii, ‘boxedhippo.nii’)

We can then use these masks for signal extraction or any further processing.

Apr 202010
 

Some of the countries that had remarkably high data transfer rates were reporting a drop in network speeds as a result of smart phones gaining popularity over the past year or so. Following that train of links, one ends up article after article about which nation ranks first in network speeds, and where US lies on that list and so on. There was one website which gave a really comprehensive set of results and analysis, right till the ISP level for pretty much every nation on the planet.

speedtest.net

Speedtest - Analyze network speeds and compare results

Seems like the site is pretty up to date too.

Mar 042009
 

In our functional imaging lab we have a poster of Electromagetic radiation spectrum. The chart goes from wavelengths corresponding to millihertz all the way up to EHz which is in 10^18 Hz range. It also describes the kind of systems that use those wavelengths, like for example the 87 to 108 MHz range is used for FM radio broadcasting and so on. I wanted to have that poster for myself so I looked around to see where I can buy one online. I found it on Unihedron website.

EM Radiation Spectrum Chart closeup

EM Radiation Spectrum Chart closeup

The person who created the website has the poster available for download – some of them in PDF and JPG formats. The posters are also on sale on that website, and at least as far as the EM radation spectrum poster goes, its available at quite an affordable price on that website.

There were other posters that were equally interesting, if you are into that kind of things. They were:

  • Value of Pi going up to 350,390 digits.
Poster of Pi: Going up to 350,390 decimals

Poster of Pi: Going up to 350,390 decimals

  • Value of e going up to 350,390 digits.

Poster of e with value going to 350,390 digits

Poster of e: Going up to 350,390 decimals

  • Primes numbers: The first 54,222 prime numbers

Poster with 54,222 primes

Poster with 54,222 primes

These are some great posters, especially the one with EM Radiation. Its a wonderful chart to have for reference if you are dealing with higher frequencies like in telecommunications or in medical imaging.

=====================