function  detail = image_extract_and_align(image, location, box_size, angle)
%  function result = image_extract_and_align(image, location, box_size, angle)
%
%  Extract a box of given size at the given location and orientation angle from the image.
%
%  Example: particle_extract(image, [x y], theta, [120 120]);

enlarged_size = round(box_size * sqrt(2));

detail = image_extract(image, location, enlarged_size);

detail = imrotate(detail, -angle, 'bicubic', 'crop');

detail = image_extract(detail, round(enlarged_size / 2), box_size);

