+2010-03-05 6.6.0-2 Cristy <quetzlzacatenango@image...>
+ * add support for the -mip option (maximum intensity projection).
+
2010-02-27 6.6.0-1 Cristy <quetzlzacatenango@image...>
* Check to see if ICON image width /height exceeds that of the image canvas.
* Set the DPX descriptor to Luma only if the image type is not TrueColor.
%define VERSION 6.6.0
-%define Patchlevel 2
+%define Patchlevel 3
Name: ImageMagick
Version: %{VERSION}
# #
# #
# #
+# M a x i m u m I n t e n s i t y P r o j e c t i o n #
+# #
+# #
+# #
+###############################################################################
+#
+#
+void
+MaximumIntensityProjection(ref)
+ Image::Magick ref=NO_INIT
+ ALIAS:
+ MaximumIntensityProjectionImage = 1
+ maximumintensityprojection = 2
+ maximumintensityprojectionimage = 3
+ PPCODE:
+ {
+ AV
+ *av;
+
+ char
+ *p;
+
+ ExceptionInfo
+ *exception;
+
+ HV
+ *hv;
+
+ Image
+ *image;
+
+ struct PackageInfo
+ *info;
+
+ SV
+ *perl_exception,
+ *reference,
+ *rv,
+ *sv;
+
+ exception=AcquireExceptionInfo();
+ perl_exception=newSVpv("",0);
+ if (sv_isobject(ST(0)) == 0)
+ {
+ ThrowPerlException(exception,OptionError,"ReferenceIsNotMyType",
+ PackageName);
+ goto PerlException;
+ }
+ reference=SvRV(ST(0));
+ hv=SvSTASH(reference);
+ image=SetupList(aTHX_ reference,&info,(SV ***) NULL,exception);
+ if (image == (Image *) NULL)
+ {
+ ThrowPerlException(exception,OptionError,"NoImagesDefined",
+ PackageName);
+ goto PerlException;
+ }
+ image=MaximumIntensityProjectionImages(image,exception);
+ if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
+ goto PerlException;
+ /*
+ Create blessed Perl array for the returned image.
+ */
+ av=newAV();
+ ST(0)=sv_2mortal(sv_bless(newRV((SV *) av),hv));
+ SvREFCNT_dec(av);
+ AddImageToRegistry(image);
+ rv=newRV(sv);
+ av_push(av,sv_bless(rv,hv));
+ SvREFCNT_dec(sv);
+ info=GetPackageInfo(aTHX_ (void *) av,info,exception);
+ (void) FormatMagickString(info->image_info->filename,MaxTextExtent,
+ "mip-%.*s",(int) (MaxTextExtent-9),
+ ((p=strrchr(image->filename,'/')) ? p+1 : image->filename));
+ (void) CopyMagickString(image->filename,info->image_info->filename,
+ MaxTextExtent);
+ SetImageInfo(info->image_info,0,exception);
+ exception=DestroyExceptionInfo(exception);
+ SvREFCNT_dec(perl_exception);
+ XSRETURN(1);
+
+ PerlException:
+ InheritPerlException(exception,perl_exception);
+ exception=DestroyExceptionInfo(exception);
+ sv_setiv(perl_exception,(IV) SvCUR(perl_exception) != 0);
+ SvPOK_on(perl_exception);
+ ST(0)=sv_2mortal(perl_exception);
+ XSRETURN(1);
+ }
+\f
+#
+###############################################################################
+# #
+# #
+# #
# M o g r i f y #
# #
# #
<configuremap>
<configure name="NAME" value="ImageMagick"/>
<configure name="LIB_VERSION" value="0x660"/>
- <configure name="LIB_VERSION_NUMBER" value="6,6,0,2"/>
- <configure name="RELEASE_DATE" value="2010-03-04"/>
+ <configure name="LIB_VERSION_NUMBER" value="6,6,0,3"/>
+ <configure name="RELEASE_DATE" value="2010-03-05"/>
<configure name="CONFIGURE" value="./configure "/>
<configure name="PREFIX" value="/usr/local"/>
<configure name="EXEC-PREFIX" value="/usr/local"/>
#! /bin/sh
# libtool - Provide generalized library-building support services.
-# Generated automatically by config.status (ImageMagick) 6.6.0-2
+# Generated automatically by config.status (ImageMagick) 6.6.0-3
# Libtool was configured on host magick.imagemagick.org:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
%
% The format of the AverageImages method is:
%
-% Image *AverageImages(Image *image,ExceptionInfo *exception)
+% Image *AverageImages(Image *images,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
return(pixels);
}
-MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
+MagickExport Image *AverageImages(const Image *images,ExceptionInfo *exception)
{
#define AverageImageTag "Average/Image"
/*
Ensure the image are the same size.
*/
- assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+ assert(images != (Image *) NULL);
+ assert(images->signature == MagickSignature);
+ if (images->debug != MagickFalse)
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
- if ((next->columns != image->columns) || (next->rows != image->rows))
- ThrowImageException(OptionError,"ImageWidthsOrHeightsDiffer");
+ for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+ if ((next->columns != images->columns) || (next->rows != images->rows))
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+ "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+ return((Image *) NULL);
+ }
/*
Initialize average next attributes.
*/
- average_image=CloneImage(image,image->columns,image->rows,MagickTrue,
+ average_image=CloneImage(images,images->columns,images->rows,MagickTrue,
exception);
if (average_image == (Image *) NULL)
return((Image *) NULL);
average_image=DestroyImage(average_image);
return((Image *) NULL);
}
- average_pixels=AcquirePixelThreadSet(image);
+ average_pixels=AcquirePixelThreadSet(images);
if (average_pixels == (MagickPixelPacket **) NULL)
{
average_image=DestroyImage(average_image);
- ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);
+ return((Image *) NULL);
}
/*
Average image pixels.
*/
status=MagickTrue;
progress=0;
- GetMagickPixelPacket(image,&zero);
- number_images=GetImageListLength(image);
+ GetMagickPixelPacket(images,&zero);
+ number_images=GetImageListLength(images);
average_view=AcquireCacheView(average_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(dynamic) shared(progress,status)
average_pixel=average_pixels[id];
for (x=0; x < (long) average_image->columns; x++)
average_pixel[x]=zero;
- next=image;
+ next=images;
for (i=0; i < (long) number_images; i++)
{
register const IndexPacket
}
if (SyncCacheViewAuthenticPixels(average_view,exception) == MagickFalse)
status=MagickFalse;
- if (image->progress_monitor != (MagickProgressMonitor) NULL)
+ if (images->progress_monitor != (MagickProgressMonitor) NULL)
{
MagickBooleanType
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp critical (MagickCore_AverageImages)
#endif
- proceed=SetImageProgress(image,AverageImageTag,progress++,
+ proceed=SetImageProgress(images,AverageImageTag,progress++,
average_image->rows);
if (proceed == MagickFalse)
status=MagickFalse;
}
return(channel_statistics);
}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% M a x i m u m I n t e n s i t y P r o j e c t i o n I m a g e s %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MaximumIntensityProjectionImages() returns the maximum intensity projection
+% of an image sequence.
+%
+% The format of the MaximumIntensityProjectionImages method is:
+%
+% Image *MaximumIntensityProjectionImages(Image *images,
+% ExceptionInfo *exception)
+%
+% A description of each parameter follows:
+%
+% o images: the image sequence.
+%
+% o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MaximumIntensityProjectionImages(const Image *images,
+ ExceptionInfo *exception)
+{
+#define MaximumIntensityProjectionImageTag "MaximumIntensityProjection/Image"
+
+ const Image
+ *next;
+
+ Image
+ *mip_image;
+
+ MagickBooleanType
+ status;
+
+ register long
+ i;
+
+ unsigned long
+ number_images;
+
+ /*
+ Ensure the image are the same size.
+ */
+ assert(images != (Image *) NULL);
+ assert(images->signature == MagickSignature);
+ if (images->debug != MagickFalse)
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
+ for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+ if ((next->columns != images->columns) || (next->rows != images->rows))
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+ "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+ return((Image *) NULL);
+ }
+ /*
+ Initialize mip_image next attributes.
+ */
+ mip_image=CloneImage(images,0,0,MagickTrue,exception);
+ if (mip_image == (Image *) NULL)
+ return((Image *) NULL);
+ if (SetImageStorageClass(mip_image,DirectClass) == MagickFalse)
+ {
+ InheritException(exception,&mip_image->exception);
+ mip_image=DestroyImage(mip_image);
+ return((Image *) NULL);
+ }
+ /*
+ Compute the maximum intensity projection.
+ */
+ i=0;
+ number_images=GetImageListLength(images);
+ for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+ {
+ status=CompositeImage(mip_image,LightenCompositeOp,next,0,0);
+ if (status == MagickFalse)
+ {
+ InheritException(exception,&mip_image->exception);
+ mip_image=DestroyImage(mip_image);
+ break;
+ }
+ if (images->progress_monitor != (MagickProgressMonitor) NULL)
+ {
+ MagickBooleanType
+ proceed;
+
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+ #pragma omp critical (MagickCore_MaximumIntensityProjectionImages)
+#endif
+ proceed=SetImageProgress(images,MaximumIntensityProjectionImageTag,i++,
+ number_images);
+ }
+ }
+ return(mip_image);
+}
*GetImageChannelStatistics(const Image *,ExceptionInfo *);
extern MagickExport Image
- *AverageImages(const Image *,ExceptionInfo *);
+ *AverageImages(const Image *,ExceptionInfo *),
+ *MaximumIntensityProjectionImages(const Image *,ExceptionInfo *);
extern MagickExport MagickBooleanType
GetImageChannelExtrema(const Image *,const ChannelType,unsigned long *,
#define MagickLibVersion 0x660
#define MagickLibVersionText "6.6.0"
#define MagickLibVersionNumber 3,0,0
-#define MagickLibAddendum "-2"
+#define MagickLibAddendum "-3"
#define MagickLibInterface 3
#define MagickLibMinInterface 3
-#define MagickReleaseDate "2010-03-04"
+#define MagickReleaseDate "2010-03-05"
#define MagickChangeDate "20100227"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#define MagickHomeURL "file:///usr/local/share/doc/ImageMagick-6.6.0/index.html"
"-flatten flatten a sequence of images",
"-fx expression apply mathematical expression to an image channel(s)",
"-hald-clut apply a Hald color lookup table to the image",
+ "-mip return the maximum intensity projection for an image sequence",
"-morph value morph an image sequence",
"-mosaic create a mosaic from an image sequence",
"-process arguments process the image with a custom image filter",
ThrowConvertException(OptionError,"MissingArgument",option);
break;
}
+ if (LocaleCompare("mip",option+1) == 0)
+ break;
if (LocaleCompare("median",option+1) == 0)
{
if (*option == '+')
% %
% %
% %
+% M a g i c k M a x i m u m I n t e n s i t y P r o j e c t i o n I m a g e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickMaximumIntensityProjectionImages() returns the maximum intensity
+% projection of an image sequence.
+%
+% The format of the MagickMaximumIntensityProjectionImages method is:
+%
+% MagickWand *MagickMaximumIntensityProjectionImages(MagickWand *wand)
+%
+% A description of each parameter follows:
+%
+% o wand: the magick wand.
+%
+*/
+WandExport MagickWand *MagickMaximumIntensityProjectionImages(MagickWand *wand)
+{
+ Image
+ *mip_image;
+
+ assert(wand != (MagickWand *) NULL);
+ assert(wand->signature == WandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ if (wand->images == (Image *) NULL)
+ return((MagickWand *) NULL);
+ mip_image=MaximumIntensityProjectionImages(wand->images,wand->exception);
+ if (mip_image == (Image *) NULL)
+ return((MagickWand *) NULL);
+ return(CloneMagickWandFromImages(wand,mip_image));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e %
% %
% %
*MagickGetImageClipMask(MagickWand *),
*MagickGetImageRegion(MagickWand *,const unsigned long,const unsigned long,
const long,const long),
+ *MagickMaximumIntensityProjectionImages(MagickWand *),
*MagickMergeImageLayers(MagickWand *,const ImageLayerMethod),
*MagickMorphImages(MagickWand *,const unsigned long),
*MagickMontageImage(MagickWand *,const DrawingWand *,const char *,
"-flatten flatten a sequence of images",
"-fx expression apply mathematical expression to an image channel(s)",
"-hald-clut apply a Hald color lookup table to the image",
+ "-mip return the maximum intensity projection for an image sequence",
"-morph value morph an image sequence",
"-mosaic create a mosaic from an image sequence",
"-process arguments process the image with a custom image filter",
ThrowMogrifyException(OptionError,"MissingArgument",option);
break;
}
+ if (LocaleCompare("mip",option+1) == 0)
+ break;
if (LocaleCompare("modulate",option+1) == 0)
{
if (*option == '+')
i++;
break;
}
+ if (LocaleCompare("mip",option+1) == 0)
+ {
+ Image
+ *morph_image;
+
+ (void) SyncImagesSettings(image_info,*images);
+ morph_image=MorphImages(*images,StringToUnsignedLong(argv[i+1]),
+ exception);
+ if (morph_image == (Image *) NULL)
+ {
+ status=MagickFalse;
+ break;
+ }
+ *images=DestroyImageList(*images);
+ *images=morph_image;
+ break;
+ }
if (LocaleCompare("morph",option+1) == 0)
{
Image