pdf reader library c# : Delete text pdf software SDK cloud windows winforms html class gmic_reference1-part94

1.6. INPUT/OUTPUTPROPERTIES
11
Omittinganargumentwheninvokinganativecommandisnotpermitted,exceptifall
followingargumentsarealsoomitted.Forinstance,callto’−plasma10,,5’isinvalid
but’−plasma10’iscorrect.
.Customcommands,aredefinedasG’MICpipelinesofnativeorcustomcommands.
TheyareinterpretedbytheG’MICinterpreter,andthusrunabitslowerthannativecommands.
Omittingargumentswheninvokingacustomcommandispermitted.Forinstance,
expressions’−flower,,,100,,2’or’−flower,’arecorrect.
−MostoftheexistingcommandsinG’MICareactuallydefinedascustomcommands.
−AusercaneasilyadditsowncustomcommandstotheG’MICinterpreter(seesection
’Addingcustomcommands’formoredetails).Newnativecommandscannotbeadded
(unlessyoumodifytheG’MICinterpretersourcecodeandrecompileit,ofcourse!).
1.6 Input/outputproperties
G’MICisabletoread/writemostoftheclassicalimagefileformats,including:
.2dgrayscale/colorfiles:.png,.jpeg,.gif,.pnm,.tif,.bmp,..
.3dvolumetricfiles:.dcm,.hdr,.nii,.pan,.inr,.pnk,..
.videofiles:.mpeg,.avi,.mov,.ogg,.flv,..
.Genericasciiorbinarydatafiles:.gmz,.cimg,.cimgz,.dlm,.asc,.pfm,.raw,.txt,.h.
.3dobjectfiles:.off.
−Whendealingwithcolorimages,G’MICgenerallyreads,writesanddisplaysdatausingthe
usualsRGBcolorspace.
G’MICisabletomanage3dobjectsthatmaybereadfromfilesorgeneratedbyG’MIC
commands.A3dobjectisstoredasaone−columnscalarimagecontainingtheobjectdata,
inthefollowingorder:{magic
number;sizes;vertices;primitives;colors;opacities}.
These3drepresentationscanbeprocessedasregularimages.
(seecommand’−split3d’foraccessingeachofthese3dobjectdataseparately).
−Beawarethatusualfileformatsmaybesometimesnotadaptedtostorealltheavailable
imagedata,sinceG’MICusesfloat−valuedimagebuffers.Forinstance,savinganimage
thatwasinitiallyloadedasa16bits/channelimage,asa.jpgfilewillresultina
lossofinformation.UsetheG’MIC−specificfileextensions.cimgzor.gmztoensure
thatalldataprecisionarepreservedwhensavingimages.
−Sometimes,fileoptionsmay/mustbesetforfileformats:
.Videofiles:Onlysub−framesofanimagesequencemaybeloaded,usingtheinput
expression’filename.ext,[first
frame[,last
frame[,step]]]’.
Set’last
frame==−1’totellitmustbethelastframeofthevideo.
Set’step’to0toforceanopenedvideofiletobeopened/closed.
Outputframerateandcodeccanbealsosetbyusingtheoutputexpression
filename.avi,
fps,
codec,
keep
open={0|1}’.
codec’isa4−charstring(seehttp://www.fourcc.org/codecs.php)or’0’forthedefaultcodec.
keep
open$’tellsiftheoutputvideofilemustbekeptopenforappendingnewframesafterwards.
..cimg[z]files:Onlycropsandsub−imagesof.cimgfilescanbeloaded,usingtheinput
Delete text pdf - delete, remove text from PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Allow C# developers to use mature APIs to delete and remove text content from PDF document
delete text pdf file; erase text in pdf document
Delete text pdf - VB.NET PDF delete text library: delete, remove text from PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET Programming Guide to Delete Text from PDF File
online pdf editor to delete text; pdf editor delete text
12
CHAPTER1. USAGE
expressions’filename.cimg,N0,N1’,’filename.cimg,N0,N1,x0,x1’,
filename.cimg,N0,N1,x0,y0,x1,y1’,’filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1’or
filename.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1’.
Specifying’−1’foronecoordinatesstandsforthemaximumpossiblevalue.
Outputexpression’filename.cimg[z][,datatype]’canbeusedtoforcetheoutputpixeltype.
datatype’canbe{uchar|char|ushort|short|uint|int|uint64|int64|float|double}.
..rawbinaryfiles:Imagedimensionsandinputpixeltypemaybespecifiedwhenloading
.rawfileswithinputexpresssion’filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]’.
Ifnodimensionsarespecified,theresultingimageisaone−columnvectorwith
maximumpossibleheight.Pixeltypecanalsobespecifiedwiththeoutput
expression’filename.raw[,datatype]’.
datatype’canbe{uchar|char|ushort|short|uint|int|uint64|int64|float|double}.
..yuvfiles:Imagedimensionsmustbespecified,andonlysub−framesofanimage
sequencemaybeloaded,usingtheinputexpression
filename.yuv,width,height[,first
frame[,last
frame[,step]]]’.
..tifffiles:Onlysub−imagesofmulti−pagestifffilescanbeloaded,usingtheinput
expression’filename.tif,
first
frame,
last
frame,
step’.
Outputexpression’filename.tiff,
datatype,
compression,
force
multipage,
use
bigtiff’canbeusedto
specifytheoutputpixeltype,aswellasthecompressionmethod.
datatype’canbe{uchar|char|ushort|short|uint|int|uint64|int64|float|double}.
compression’canbe{none(default)|lzw|jpeg}.
force
multipagecanbe{0=no(default)|1=yes}.
use
bigtiffcanbe{0=no|1=yes(default)}.
..giffiles:Animatedgiffilescanbesaved,usingtheinputexpression
filename.gif,fps>0,nb
loops’.
Specify’nb
loops=0’togetaninfinitenumberofanimationloops(default).
..jpegfiles:Theoutputqualitymaybespecified(in%),usingtheoutputexpression
filename.jpg,30’(here,togeta30%qualityoutput).’100%’isthedefault.
..mncfiles:Theoutputheadercansetfromanotherfile,usingtheoutputexpression
filename.mnc,header
template.mnc’.
..pan,.cpp,.hpp,.cand.hfiles:Theoutputdatatypecanbeselectedwithoutputexpression
filename[,datatype]’.
datatype’canbe{uchar|char|ushort|short|uint|int|uint64|int64|float|double}.
..gmicfiles:ThesefilenamesareassumedtobeG’MICcustomcommandsfiles.Loading
suchafilewilladdthecommandsitdefinestotheinterpreter.Debuginformationcanbe
enabled/disabledbytheinputexpression’filename.gmic,add
debug
info={0|1}’.
.Inserting’ext:’onthebeginningofafilename(e.g.’jpg:filename’)forcesG’MICto
read/writethefileasitwouldhavebeendoneifithadthespecifiedextension’.ext’.
−Someinput/outputformatsandoptionsmaynotbesupported,dependingontheconfigurationflags
setduringthebuildoftheG’MICsoftware.
VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
›› VB.NET PDF: Delete PDF Page. VB.NET PDF - How to Delete PDF Document Page in VB.NET. Visual Basic Sample Codes to Delete PDF Document Page in VB.NET Class.
how to delete text from pdf with acrobat; pdf text watermark remover
C# PDF Page Delete Library: remove PDF pages in C#.net, ASP.NET
Page: Delete Existing PDF Pages. |. Home ›› XDoc.PDF ›› C# PDF: Delete PDF Page. C#.NET PDF Library - Delete PDF Document Page in C#.NET.
delete text from pdf; remove text from pdf preview
1.7. SUBSTITUTIONRULES
13
1.7 Substitutionrules
G’MICitemscontaining’$’or’{}’aresubstitutedbeforebeinginterpreted.
Usethesesubstitutingexpressionstoaccessvariousdatafromtheinterpreterenvironment.
−’$name’and’${name}’arebothsubstitutedbythevalueofthespecifiednamedvariable
(setpreviouslybytheitem’name=value’).Ifthisvariablehasnotbeenalreadyset,
theexpressionissubstitutedbythehighestpositiveindiceofthenamedimage’[name]’.
Ifnoimagehasthisname,theexpressionissubstitutedbythevalueofthe
OSenvironmentvariablewithsamename(itmaybethusanemptystring).
ThefollowingreservedvariablesarepredefinedbytheG’MICinterpreter:
.’$!’:Thecurrentnumberofimagesinthelist.
.’$>’and’$<’:Theincreasing/decreasingindiceofthelatest(currentlyrunning)
repeat..done’loop.
.’$/’:Thecurrentcallstack.Stackitemsareseparatedbyslashes’/’.
.’$|’:Thecurrentvalue(expressedinseconds)ofamillisecondprecisiontimer.
.’’:Thecurrentverbositylevel.
.’$
cpus’:Thenumberofcomputationcoresavailableonyourmachine.
.’$
pid’:Thecurrentprocessidentifier,asaninteger.
.’$
prerelease’:Forpre−releasesonly,thedateofthepre−releaseas’mmddyy’.
Forstablereleases,thisvariableisnotdefined.
.’$
version’:A3−digitsnumbertellingaboutthecurrentversionoftheG’MICinterpreter.
(currently’172’).
.’$
vt100’:Setto1(defaultvalue)ifcoloredtextoutputisallowedontheconsole.
.’$
path
rc’:ThepathtotheG’MICfolderusedtostoreresourcesandconfigurationfiles
(itsvalueisOS−dependent).
.’$
path
user’:ThepathtotheG’MICuserfile.gmicoruser.gmic(itsvalueisOS−dependent).
−’${”commandline”}’issubstitutedbythestatusvaluesetbytheexecutionofthe
specifiedcommandline(seecommand’−status’tolearnmoreaboutstatus).
Expression’${}’thusstandsforthecurrentstatusvalue.
−’{‘‘string}’issubstitutedbyadouble−quotedversionofthespecifiedstring.
−’{/string}’issubstitutedbytheescapedversionofthespecifiedstring.
−’{’string’}’(singlequotes)issubstitutedbythesequenceofasciicodesthatcompose
thespecifiedstring,separatedbycommas’,’.Forinstance,item’{’foo’}’issubstituted
by’102,111,111’.
−’{image,feature}’issubstitutedbyaspecificfeatureoftheimage[image].
image’canbeeitheranimagenumberoranimagename.Itcanbealsoeluded.
Inwhichcase,thelastimage’[−1]’ofthelistisconsideredfortherequestedfeature.
Specified’feature’canbeoneof:
.’b’:Theimagebasename(i.e.filenamewithoutthefolderpathnorextension).
.’f’:Theimagefoldername.
.’n’:Theimagenameorfilename(iftheimagehasbeenreadfromafile).
.’t’:Thetextstringfromtheimagevaluesregardedasasciicodes.
.’x’:Theimageextension(i.elastcharactersafterthelast’.’intheimagename).
.’ˆ:Thesequenceofallimagevalues,separatedbycommas’,’.
VB.NET PDF Text Extract Library: extract text content from PDF
PDF ›› VB.NET PDF: Extract PDF Text. VB.NET PDF - Extract Text from PDF Using VB. How to Extract Text from PDF with VB.NET Sample Codes in .NET Application.
how to delete text in pdf converter professional; delete text from pdf file
C# PDF Text Extract Library: extract text content from PDF file in
XDoc.PDF ›› C# PDF: Extract PDF Text. C# PDF - Extract Text from PDF in C#.NET. Feel Free to Extract Text from PDF Page, Page Region or the Whole PDF File.
how to delete text from a pdf in acrobat; deleting text from a pdf
14
CHAPTER1. USAGE
.’@subset’:Thesequenceofimagevaluescorrespondingtothespecifiedsubset,
andseparatedbycommas’,’.
.Anyother’feature’isconsideredasamathematicalexpressionassociatedto
theimage[image]andissubstitutedbytheresultofitsevaluation(floatvalue).
Forinstance,expression’{0,w+h}’issubstitutedbythesumofthewidthandheight
ofthefirstimage(seesection’Mathematicalexpressions’formoredetails).
Ifamathematicalexpressionstartswithanunderscore’
’,theresultingvalueis
truncatedtoareadableformat.Forinstance,item’{
pi}’issubstitutedby’3.14159
(while’{pi}’is’3.141592653589793’).
.A’feature’delimitedbybackquotesisreplacedbyastringwhoseasciicodescorrespond
tothelistofvaluesresultingfromtheevaluationofthespecifiedmathematicalexpression.
Forinstance,item’{‘[102,111,111]‘}’issubstitutedby’foo’anditem’{‘vector8(65)‘}
by’AAAAAAAA
−’{∗}’issubstitutedbythevisibilitystateoftheinstantdisplaywindow[0]
(canbe{0=closed|1=visible}).
−’{∗,feature}’or’{∗indice,feature}’issubstitutedbyaspecificfeatureofthe
instantdisplaywindow#0(or#indice,ifspecified).Requested’feature’canbe:
.’w’:displaywidth(i.e.widthofthedisplayareamanagedbythewindow).
.’h’:displayheight(i.e.heightofthedisplayareamanagedbythewindow).
.’wh’:displaywidthxdisplayheight.
.’d’:windowwidth(i.e.widthofthewindowwidget).
.’e’:windowheight(i.e.heightofthewindowwidget).
.’de’:windowwidthxwindowheight.
.’u’:screenwidth(actuallyindependentonthewindowsize).
.’v’:screenheight(actuallyindependentonthewindowsize).
.’uv’:screenwidthxscreenheight.
.’n’:currentnormalizationtypeoftheinstantdisplay.
.’t’:windowtitleoftheinstantdisplay.
.’x’:X−coordinateofthemouseposition(or−1,ifoutsidethedisplayarea).
.’y’:Y−coordinateofthemouseposition(or−1,ifoutsidethedisplayarea).
.’b’:stateofthemousebuttons{1=left−but.|2=right−but.|4=middle−but.}.
.’o’:stateofthemousewheel.
.’k’:decimalcodeofthepressedkeyifany,0otherwise.
.’c’:boolean(0or1)tellingiftheinstantdisplayhasbeenclosedrecently.
.’r’:booleantellingiftheinstantdisplayhasbeenresizedrecently.
.’m’:booleantellingiftheinstantdisplayhasbeenmovedrecently.
.Anyother’feature’standsforakeycodename(incapitalletters),andissubstituted
byabooleandescribingthecurrentkeystate{0=pressed|1=released}.
.Youcanalsoprependahyphen’’toa’feature’(thatsupportsit)toflushthe
correspondingeventimmediatelyafterreadingitsstate(worksforkeys,mouse
andwindowevents).
−Itemsubstitutionisneverperformedinitemsbetweendoublequotes.Onemustbreakthequotes
toenablesubstitutionifneeded,asin”3+8kg=”{3+8}”kg”.Usingdoublequotes
isthenaconvenientwaytodisablethesubstitutionsmechanisminitems,whennecessary.
−Onecanalsodisablethesubstitutionmechanismonitemsoutsidedoublequotes,by
escapingthe’{’,’}’or’$’characters,asin’\{3+4\}\doesn’t\evaluate’.
C# PDF insert text Library: insert text into PDF content in C#.net
Text to PDF. C#.NET PDF SDK - Insert Text to PDF Document in C#.NET. Providing C# Demo Code for Adding and Inserting Text to PDF File Page with .NET PDF Library.
delete text pdf files; delete text pdf acrobat professional
C# PDF Convert to Text SDK: Convert PDF to txt files in C#.net
C#.NET PDF SDK - Convert PDF to Text in C#.NET. Integrate following RasterEdge C#.NET text to PDF converter SDK dlls into your C#.NET project assemblies;
how to erase pdf text; how to delete text in pdf preview
1.8. MATHEMATICALEXPRESSIONS
15
1.8 Mathematicalexpressions
G’MIChasanembeddedmathematicalparser.Itisusedtoevaluateexpressionsinside
braces’{}’,orformulasincommandsthatmaytakeoneasanargument(e.g.’−fill’).
−Whenusedasacommandargument,aformulaisevaluatedforeachpixeloftheselectedimages.
−Themathematicalparserunderstandsthefollowingsetoffunctions,operatorsandvariables:
Usualoperators:||(logicalor),&&(logicaland),|(bitwiseor),&(bitwiseand),
!=,==,<=,>=,<,>,<<(leftbitwiseshift),>>(rightbitwiseshift),−,+,∗,/,
%(modulo),ˆ(power),!(logicalnot),˜(bitwisenot),
++,−−,+=,−=,∗=,/=,%=,&=,|=,ˆ=,>>=,<<=(in−placeoperators).
Usualfunctions:abs(),acos(),arg(),argmax(),argmin(),asin(),atan(),atan2(),
cbrt(),cos(),cosh(),cut(),exp(),fact(),fibo(),gauss(),hypoth(),int(),isval(),isnan(),isinf(),
isint(),isbool(),isfile(),isdir(),isin(),kth(),log(),log2(),log10(),max(),mean(),
med(),min(),narg(),prod(),rol()(leftbitrotation),ror()(rightbitrotation),
round(),sign(),sin(),sinc(),sinh(),sqrt(),std(),sum(),tan(),tanh(),variance().
.’atan2(x,y)’istheversionof’atan()’withtwoarguments’y’and’x’(asinC/C++).
.’hypoth(x,y)’computesthesquarerootofthesumofthesquaresofxandy.
.’permut(k,n,with
order)’computesthenumberofpermutationsofkobjectsfromasetofkobjects.
.’gauss(x,
sigma)’returns’exp(−xˆ2/(2∗sˆ2))/sqrt(2∗pi∗sigmaˆ2)’.
.’cut(value,min,max)’returnsvalueifitisinrange[min,max],orminormaxotherwise.
.’narg(a
1,...,a
N)’returnsthenumberofspecifiedarguments(here,N).
.’arg(i,a
1,..,a
N)’returnstheithargumenta
i.
.’isval()’,’isnan()’,’isinf()’,’isint()’,’isbool()’testthetypeof
thegivennumberorexpression,andreturn0(false)or1(true).
.’isfile()’(resp.’isdir()’)returns0(false)or1(true)whetheritsargument
isavalidpathtoafile(resp.toadirectory)ornot.
.’isin(v,a
1,...,a
n)’returns0(false)or1(true)whetherthefirstvalue’v’appears
inthesetofothervalues’a
i’.
.’argmin()’,’argmax()’,’kth()’,’max()’,’mean()’,’med()’,’min()’,’std()’,’sum()
and’variance()’canbecalledwithanarbitrarynumberofscalar/vectorarguments.
.’round(value,rounding
value,direction)’returnsaroundedvalue.
direction’canbe{−1=to−lowest|0=to−nearest|1=to−highest}.
Variablenamesbelowarepre−defined.Theycanbeoverrided.
.’w’:widthoftheassociatedimage,ifany(0otherwise).
.’h’:heightoftheassociatedimage,ifany(0otherwise).
.’d’:depthoftheassociatedimage,ifany(0otherwise).
.’s’:spectrumoftheassociatedimage,ifany(0otherwise).
.’r’:sharedstateoftheassociatedimage,ifany(0otherwise).
.’wh’:shortcutforwidthxheight.
.’whd’:shortcutforwidthxheightxdepth.
.’whds’:shortcutforwidthxheightxdepthxspectrum(i.e.totalnumberofpixelvalues).
.’i’:currentprocessedpixelvalue(i.e.valuelocatedat(x,y,z,c))inthe
associatedimage,ifany(0otherwise).
.’iN’:Nthchannelvalueofcurrentprocessedpixel(i.e.valuelocatedat(x,y,z,N))in
theassociatedimage,ifany(0otherwise).’N’mustbeanintegerinrange[0,7].
VB.NET PDF Convert to Text SDK: Convert PDF to txt files in vb.net
VB.NET PDF - Convert PDF to Text Using VB. Integrate following RasterEdge text to PDF converter SDK dlls into your VB.NET project assemblies;
how to delete text in pdf acrobat; how to delete text in pdf document
C# PDF Text Search Library: search text inside PDF file in C#.net
Text: Search Text in PDF. C# Guide about How to Search Text in PDF Document and Obtain Text Content and Location Information with .NET PDF Control.
how to delete text from a pdf; remove text from pdf acrobat
16
CHAPTER1. USAGE
.’R’,’G’,’B’and’A’areequivalentto’i0’,’i1’,’i2’and’i3’respectively.
.’im’,’iM’,’ia’,’iv’,’is’,’ip’,’ic’:Respectivelytheminimum,maximum,averagevalues,
variance,sum,productandmedianvalueoftheassociatedimage,ifany(0otherwise).
.’xm’,’ym’,’zm’,’cm’:Thepixelcoordinatesoftheminimumvalueintheassociated
image,ifany(0otherwise).
.’xM’,’yM’,’zM’,’cM’:Thepixelcoordinatesofthemaximumvalueintheassociated
image,ifany(0otherwise).
.Youmayadd’#ind’toanyofthevariablenameabovetoretrievetheinformationforany
numberedimage[ind]ofthelist(whenthismakessense).Forinstance’ia#0’denotesthe
averagevalueofthefirstimage).
.’x’:currentprocessedcolumnoftheassociatedimage,ifany(0otherwise).
.’y’:currentprocessedrowoftheassociatedimage,ifany(0otherwise).
.’z’:currentprocessedsliceoftheassociatedimage,ifany(0otherwise).
.’c’:currentprocessedchanneloftheassociatedimage,ifany(0otherwise).
.’t’:threadidwhenanexpressionisevaluatedwithmultiplethreads(0means’masterthread’).
.’e’:valueofe,i.e.2.71828..
.’pi’:valueofpi,i.e.3.1415926..
.’u’:arandomvaluebetween[0,1],followingauniformdistribution.
.’g’:arandomvalue,followingagaussiandistributionofvariance1
(roughlyin[−6,6]).
.’interpolation’:valueofthedefaultinterpolationmodeusedwhenreadingpixelvalueswith
thepixelaccessoperators(i.e.whentheinterpolationargumentisnotexplicitlyspecified,
seebelowformoredetailsonpixelaccessoperators).Itsinitialdefaultvalueis0.
.’boundary’:valueofthedefaultboundaryconditionsusedwhenreadingpixelvalueswith
thepixelaccessoperators(i.e.whentheboundaryconditionargumentisnotexplicitlyspecified,
seebelowformoredetailsonpixelaccessoperators).Itsinitialdefaultvalueis0.
Vectorcalculus:Mostoperatorsarealsoabletoworkwithvector−valuedelements.
.’[a0,a1,..,aN]’definesa(N+1)−dimensionalvectorwithspecifiedscalarcoefficientsak.
.’vectorN(a0,a1,,..,)’doesthesame,withtheakbeingrepeatedperiodically.
.Inbothexpressions,theakcanbevectorsthemselves,tobeconcatenatedintoasinglevector.
.ThescalarelementakofavectorXisretrievedbyX[k].
.Thesub−vector[ap..aq]ofavectorXisretrievedbyX[p,q].
.Equality/inequalitycomparisonsbetweentwovectorsispossiblewiththeoperators’==’and’!=’.
.Somevector−specificfunctionscanbeusedonvectorvalues:
cross(X,Y)’(crossproduct),’dot(X,Y)’(dotproduct),’size(X)’(vectordimension),
sort(X,
is
increasing,
chunk
size)’(sortingvalues),’reverse(A)’(reverseorderofcomponents)
and’same(A,B,
nb
vals,
is
case
sensitive)’(vectorequalitytest).
.Function’resize(A,size,
interpolation)’returnsaresizedversionofvector’A
withspecifiedinterpolationmode.’interpolation’canbe
{−1=none(memorycontent)|0=none|1=nearest|2=average|3=linear|4=grid|5=bicubic|
6=lanczos}.
.A2−dimensionalvectormaybeseenasacomplexnumberandusedinthoseparticularfunctions/operators:
∗∗’(complexmultiplication),’//’(complexdivision),’ˆˆ’(complexexponentiation),
∗∗=’(complexself−multiplication),’//=’(complexself−division),’ˆˆ=’(complexself−exponentiation),
cabs()’(complexmodulus),’carg()’(complexargument),’cconj()’(complexconjugate),
cexp()’(complexexponential)and’clog()’(complexlogarithm).
.AMN−dimensionalvectormaybeseenasaMxNmatrixandusedinthoseparticularfunctions/operators:
∗∗’(matrix−vectormultiplication),’det(A)’(determinant),’diag(V)’(diagonalmatrixfromvector),
eig(A)’(eigenvalues/eigenvectors),’eye(n)’(nxnidentitymatrix),’inv(A)’(matrixinverse),
mul(A,B,
nb
colsB)’(matrix−matrixmultiplication),’rot(x,y,z,angle)’(3drotationmatrix),
rot(angle)’(2drotationmatrix),’solve(A,B,
nb
colsB)’(least−squaresolveroflinearsystemA.X=B),
trace(A)’(matrixtrace)and’transp(A,nb
colsA)’(matrixtranspose).
1.8. MATHEMATICALEXPRESSIONS
17
Argument’nb
colsB’maybeomittedifequalto1.
.Specifyingavector−valuedmathexpressionasanargumentofacommandthatoperatesonimagevalues
(e.g.’−fill’)modifiesthewholespectrumrangeoftheprocessedimage(s),foreachspatial
coordinates(x,y,z).ThecommanddoesnotloopovertheC−axisinthiscase.
Stringmanipulation:Characterstringsaredefinedandmanagedasvectorsobjects.
Dedicatedfunctionsandinitializerstomanagestringsare
.’[’string’]’definesavectorwhosevaluesaretheasciicodesofthespecifiedcharacterstring.
.’’string’’doesthesame,onlyforstringswithalengthgreaterthan2andthatdonotcontainssinglequotes.
Forasinglecharacter,itresultsinascalarvalueinstead(e.g.’A’isequalto65).
.Aspecialcasehappensforemptystrings:Valuesofbothexpressions’[’’]’and’’’’are0.
.Functions’lowercase()’and’uppercase()’returnstringwithallstringcharacterslowercasedoruppercased.
Specialoperatorscanbeused:
.’;’:expressionseparator.Thereturnedvalueisalwaysthelastencountered
expression.Forinstanceexpression’1;2;pi’isevaluatedas’pi’.
.’=’:variableassignment.Variablesinmathematicalparsercanonlyreferto
numericalvalues.Variablenamesarecase−sensitive.Usethisoperatorin
conjunctionwith’;’todefinemorecomplexevaluableexpressions,suchas
t=cos(x);3∗tˆ2+2∗t+1’.
Thesevariablesremainlocaltothemathematicalparserandcannotbeaccessed
outsidetheevaluatedexpression.
Thefollowingspecificfunctionsarealsodefined:
.’normP(u1,...,un)’computestheLP−normofthespecifiedvector
(Pbeinganunsignedintegeror’inf’).
.’u(max)’or’u(min,max)’:returnarandomvaluebetween[0,max]or[min,max],
followingauniformdistribution.
.’i(
a,
b,
c,
d,
interpolation
type,
boundary
conditions)’:returnthevalueofthepixel
locatedatposition(a,b,c,d)intheassociatedimage,ifany(0otherwise).
interpolation
type’canbe{0=nearestneighbor|other=linear}.
boundary
conditions’canbe{0=dirichlet|1=neumann|2=periodic}.
Omittedcoordinatesarereplacedbytheirdefaultvalueswhicharerespectively
x,y,z,c,interpolationandboundary.
Forinstancecommand’−fill0.5∗(i(x+1)−i(x−1))’willestimatetheX−derivative
ofanimagewithaclassicalfinitedifferencescheme.
.’j(
dx,
dy,
dz,
dc,
interpolation
type,
boundary
conditions)’doesthesameforthepixel
locatedatposition(x+dx,y+dy,z+dz,c+dc)(pixelaccessrelativetothecurrentcoordinates).
.’i[offset,
boundary
conditions]’returnsthevalueofthepixellocatedatspecified’offset
intheassociatedimagebuffer(or0ifoffsetisout−of−bounds).
.’j[offset,
boundary
conditions]’doesthesameforanoffsetrelativetothecurrentpixel(x,y,z,c).
.’i(#ind,
x,
y,
z,
c,
interpolation,
boundary)’,’j(#ind,
dx,
dy,
dz,
dc,
interpolation,
boundary)’,
i[#ind,offset,
boundary]’and’i[offset,
boundary]’aresimilarexpressionsusedtoaccess
pixelvaluesforanynumberedimage[ind]ofthelist.
.’I/J[offset,
boundary
conditions]’and’I/J(#ind,
x,
y,
z,
interpolation,
boundary)’dothesame
as’i/j[offset,
boundary
conditions]’and’i/j(#ind,
x,
y,
z,
c,
interpolation,
boundary)’but
returnavectorinsteadofascalar(e.g.avector[R,G,B]forapixelat(a,b,c)inacolorimage).
.’crop(
#ind,
x,
y,
z,
c,
dx,
dy,
dz,
dc,
boundary)’returnsavectorwhosevaluescomefromthe
croppedregionofimage[ind](orfromdefaultimageselectedif’ind’isnotspecified).
Croppedregionstartsfrompoint(x,y,z,c)andhasasizeofdxxdyxdzxdc.Argumentsfor
coordinatesandsizescanbeomittediftheyarenotambiguous(e.g.’crop(#ind,x,y,dx,dy)’isa
18
CHAPTER1. USAGE
validinvokationofthisfunction).
.’draw(
#ind,S,x,y,z,c,dx,
dy,
dz,
dc,
opacity,
M,
max
M)’drawsaspriteSinimage[ind]
(orindefaultimageselectedif’ind’isnotspecified)atspecifiedcoordinates(x,y,z,c).
Thesizeofthespritedxxdyxdzxdcmustbespecified.Youcanalsospecifyacorresponding
opacitymaskMifitssizematchesS.
.’if(condition,expr
then,
expr
else)’:returnvalueof’expr
then’or’expr
else’,
dependingonthevalueof’condition(0=false,other=true).’expr
else’canbe
omittedinwhichcase0isreturnediftheconditiondoesnothold.Usingtheternaryoperator
condition?expr
then[:expr
else]’givesanequivalentexpression.
Forinstance,G’MICcommands’−fillif(x%10==0,255,i)’and’−fillx%10?i:255’bothdrawblank
verticallinesonevery10thcolumnofanimage.
.’dowhile(expression,
condition)’repeatstheevaluationof’expression’until’condition
vanishes(oruntil’expression’vanishesifno’condition’isspecified).Forinstance,
theexpression:’if(N<2,N,n=N−1;F0=0;F1=1;dowhile(F2=F0+F1;F0=F1;F1=F2,n=n−1))’returns
theNthvalueoftheFibonaccisequence,forN>=0(e.g.,46368forN=24).
dowhile(expression,condition)’alwaysevaluatesthespecifiedexpressionatleastonce,
thencheckforthenullitycondition.Whendone,itreturnsthelastvalueof’expression’.
.’for(init,condition,
procedure,body)’firstevaluatestheexpression’init’,theniteratively
evaluates’body’(followedby’procedure’ifspecified)while’condition’isverified
(i.e.notzero).Itmayhappenthatnoiterationisdone,inwhichcasethefunction
returns0.Otherwise,itreturnsthelastvalueof’body’.
Forinstance,theexpression:’if(N<2,N,for(n=N;F0=0;F1=1,n=n−1,F2=F0+F1;F0=F1;F1=F2))
returnstheNthvalueoftheFibonaccisequence,forN>=0(e.g.,46368forN=24).
.’whiledo(condition,expression)’isexactlythesameas’for(init,condition,expression)
withoutthespecificationofaninitializingexpression.
.’date(attr,path)’returnsthedateattributeforthegiven’path’(fileordirectory),
with’attr’being{0=year|1=month|2=day|3=dayofweek|4=hour|5=minute|6=second}.
.’date(
attr)returnsthespecifiedattributeforthecurrent(locale)date.
.’print(expression)printsthevalueofthespecifiedexpressionontheconsole
(andreturnsitsvalue).
.’debug(expression)printsdetaileddebuginformationaboutthesequenceofoperations
donebythemathparsertoevaluatetheexpression(andreturnsitsvalue).
.’init(expression)evaluatesthespecifiedexpressiononlyonce,evenwhenmultiple
evaluationsarerequired(e.g.in’−fillinit(foo=0);++foo’).
.’copy(dest,src,
nb
elts,
inc
d,
inc
s)copiesanentirememoryblockof’nb
elts’elements
startingfromasourcevalue’src’toaspecifieddestination’dest’,withincrements
definedby’inc
d’and’inc
s’respectivelyforthedestinationandsourcepointers.
User−definedfunctions:
.Custommacrofunctionscanbedefinedinamathexpression,usingtheassignmentoperator’=’,e.g.
foo(x,y)=cos(x+y);result=foo(1,2)+foo(2,3)’.
.Overridingabuilt−infunctionhasnoeffect.
.Overridinganalreadydefinedmacrofunctionreplacesitsolddefinition.
.Macrofunctionsareindeedprocessedasmacrosbythemathematicalevaluator.Youshouldavoidinvoking
themwithargumentsthatarethemselvesresultsofassignmentsorself−operations.Forinstance,
foo(x)=x+x;z=0;result=foo(++x)’willset’result=4’ratherthanexpectedvalue’2’.
Multi−threadedandin−placeevaluation:
.IfyourimagedataarelargeenoughandyouhaveseveralCPUsavailable,itislikelythat
themathexpressionpassedtoa’−fill’or’−input’commandisevaluatedinparallel,using
multiplecomputationthreads.
.Startinganexpressionwith’:’or’’forcestheevaluationsrequiredforanimagetoberunin
1.9. IMAGEANDDATAVIEWERS
19
parallel,eveniftheamountofdatatoprocessissmall(beware,itmaybeslowertoevaluate!).
Specify’:’(insteadof’’)toavoidpossibleimagecopydonebeforeevaluatingtheexpression
(thissavesmemory,butdothisonlyifyouaresurethisstepisnotrequired!)
.Ifthespecifiedexpressionstartswith’>’or’<’,thepixelaccessoperators
i(),i[],j()’and’j[]’returnvaluesoftheimagebeingcurrentlymodified,
inforward(’>’)orbackward(’<’)order.Themulti−threadingevaluationoftheexpressionis
alsodisabledinthiscase.
.Function’(operands)’forcestheexecutionofthegivenoperandsinasinglethreadatatime.
Expressions’i(
#ind,x,
y,
z,
c)=value’,’j(
#ind,x,
y,
z,
c)=value’,’i[
#ind,offset]=value’and
j[
#ind,offset]=value’setapixelvalueatadifferentlocationthantherunningoneinthe
image[ind](orintheassociatedimageifargument’#ind’isomitted),eitherwithglobal
coordinates/offsets(with’i(...)’and’i[...]’),orrelativelytothecurrentposition(x,y,z,c)
(with’j(...)’and’j[...]’).Theseexpressionsalwaysreturn’value’.
−Thelastimageofthelistisalwaysassociatedtotheevaluationsof’{expressions}’,
e.g.G’MICsequence’256,128−f{w}’willcreatea256x128imagefilledwithvalue256.
1.9 Imageanddataviewers
G’MIChassomeveryhandyembeddedvisualizationmodules,for1dsignals
(command’−plot’),1d/2d/3dimages(command’−display’)and3dobjects
(command’−display3d’).Itmanagesinteractiveviewsoftheselectedimagedata.
−Thefollowingkeyboardshortcutsareavailableintheinteractiveviewers:
.(mousewheel):Zoomin/out.
.CTRL+D:Increasewindowsize.
.CTRL+C:Decreasewindowsize.
.CTRL+R:Resetwindowsize.
.CTRL+W:Closewindow.
.CTRL+F:Togglefullscreenmode.
.CTRL+S:Savecurrentwindowsnapshotasnumberedfile’gmic
xxxx.bmp’.
.CTRL+O:Savecurrentinstanceofthevieweddata,asnumberedfile’gmic
xxxx.cimgz’.
−Shortcutsspecifictothe1d/2d/3dimageviewer(command’−display’)are:
.CTRL+A:Switchcursormode.
.CTRL+P:Playz−stackofframesasamovie(forvolumetric3dimages).
.CTRL+V:Show/hide3Dview(forvolumetric3dimages).
.CTRL+(mousewheel):Goup/down.
.SHIFT+(mousewheel):Goleft/right.
.NumericPAD:Zoomin/out(+/−)andmovethroughzoomedimage(digits).
.BACKSPACE:Resetzoomscale.
−Shortcutsspecifictothe3dobjectviewer(command’−display3d’)are:
.(mouse)+(leftmousebutton):Rotate3dobject.
.(mouse)+(rightmousebutton):Zoom3dobject.
.(mouse)+(middlemousebutton):Shift3dobject.
.CTRL+F1..CTRL+F6:Togglebetweendifferent3drenderingmodes.
20
CHAPTER1. USAGE
.CTRL+Z:Enable/disablez−bufferedrendering.
.CTRL+A:Show/hide3daxes.
.CTRL+G:Save3dobject,asnumberedfile’gmic
xxxx.off’.
.CTRL+T:Switchbetweensingle/double−sided3dmodes.
1.10 Addingcustomcommands
−Newcustomcommandscanbeaddedbytheuser,throughtheuseofG’MICcustomcommandsfiles.
−Acommandfileisasimpleasciitextfile,whereeachlinestartseitherby
command
name:command
definition’or’command
definition(continuation)’.
−Atstartup,G’MICautomaticallyincludesuser’scommandfile$HOME/.gmic(onUnix)or
%APPDATA%/user.gmic(onWindows).TheCLItool’gmic’automaticallyrunsthecommand
−cli
start’ifdefined.
−Customcommandnamesmustusecharacterset[a−zA−Z0−9
]andcannotstartwithanumber.
−Any’#comment’expressionfoundinacustomcommandsfileisdiscardedbytheG’MIC
parser,whereveritislocatedinaline.
−Inacustomcommand,thefollowing$−expressionsarerecognizedandsubstituted:
.’$∗’issubstitutedbyacopyofthespecifiedstringofarguments.
.’$”∗”’issubstitutedbyacopyofthespecifiedstringofarguments,eachbeingdouble−quoted.
.’$#’issubstitutedbythemaximumindiceofknownarguments(eitherspecifiedbythe
userorsettoadefaultvalueinthecustomcommand).
.’$?’issubstitutedbyastringtellingaboutthecommandsubsetrestriction(only
usefulwhencustomcommandsneedtooutputdescriptivemessages).
.’$i’and’${i}’arebothsubstitutedbytheiˆthspecifiedargument.Negativeindices
suchas’${−j}’areallowedandrefertothejˆthlatestargument.’$0’issubstituted
bythecustomcommandname.
.’${i=default}’issubstitutedbythevalueof$i(ifdefined)orbyitsnewvalueset
to’default’otherwise(’default’maybea$−expressionaswell).
.’${subset}’issubstitutedbytheargumentvalues(separatedbycommas’,’)ofa
specifiedargumentsubset.Forinstanceexpression’${2−−2}’issubstituedbyall
specifiedcommandargumentsexceptthefirstandthelastone.Expression’${ˆ0}’is
thensubstitutedbyallargumentsoftheinvokedcommand(eq.to’$∗’ifallspecified
argumentshaveindeedavalue).
.’$=var’issubstitutedbythesetofinstructionsthatwillassigneachargument$i
tothenamedvariable’var$i’(foriin[0..$#]).Thisisparticularlyusefulwhena
customcommandwanttomanagevariablenumbersofarguments.Variablesnamesmust
usecharacterset[a−zA−Z0−9
]andcannotstartwithanumber.
−Theseparticular$−expressionsforcustomcommandsarealwayssubstituted,evenindoublequoted
itemsorwhenthedollarsign’$’isescapedwithabackslash’\’.Toavoidsubstitution,
placeanemptydoublequotedstringjustafterthe’$’(asin’$””1’).
−Specifyingargumentsmaybeskippedwheninvokingacustomcommand,byreplacingthemby
commas’,’asinexpression’−flower,,3’.Omittedargumentsaresettotheirdefault
values,whichmustbethusexplicitlydefinedinthecodeofthecorrespondingcustom
Documents you may be interested
Documents you may be interested