diff --git a/DESCRIPTION b/DESCRIPTION index 776c1ff..b431935 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: extrantsr Type: Package Title: Extra Functions to Build on the 'ANTsR' Package -Version: 3.9.12.1 +Version: 3.9.13 Authors@R: c(person(given = "John", family = "Muschelli", email = "muschellij2@gmail.com", @@ -15,10 +15,12 @@ Imports: methods, stats, grDevices, graphics, utils, oro.nifti, ANTsR 2.17.1), WhiteStripe, matrixStats, R.matlab, abind, R.utils, plyr, RNifti, stapler BugReports: https://github.com/muschellij2/extrantsr/issues -RoxygenNote: 7.0.1 +RoxygenNote: 7.1.0 Remotes: muschellij2/neurobase, muschellij2/fslr, bjw34032/oro.nifti, muschellij2/kirby21.t1, ANTsX/ANTsR, ANTsX/ANTsRCore, muschellij2/stapler +SystemRequirements: FSL Suggests: knitr, rmarkdown, kirby21.t1, covr, neuroim VignetteBuilder: knitr Encoding: UTF-8 +FSL: true diff --git a/R/face_removal_mask_ants.R b/R/face_removal_mask_ants.R index 3c0febd..85794c3 100644 --- a/R/face_removal_mask_ants.R +++ b/R/face_removal_mask_ants.R @@ -19,7 +19,7 @@ #' #' @examples #' \donttest{ -#' if (have_fsl()) { +#' if (fslr::have_fsl()) { #' file = "~/Downloads/sample_T1_input.nii.gz" #' if (file.exists(file)) { #' mask = face_removal_mask_ants(file = file, diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..da7aee2 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,157 @@ + + + + + + + + +Page not found (404) • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html new file mode 100644 index 0000000..642489d --- /dev/null +++ b/docs/LICENSE-text.html @@ -0,0 +1,832 @@ + + + + + + + + +License • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    {one line to give the program's name and a brief idea of what it does.}
+    Copyright (C) {year}  {name of author}
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    {project}  Copyright (C) {year}  {fullname}
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
+
+ +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/docs/articles/brain_extract.html b/docs/articles/brain_extract.html new file mode 100644 index 0000000..ce6ac02 --- /dev/null +++ b/docs/articles/brain_extract.html @@ -0,0 +1,311 @@ + + + + + + + +Brain Extraction and Segmentation • extrantsr + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

All code for this document is located at here.

+

In this tutorial we will discuss performing brain segmentation using the brain extraction tool (BET) in fsl and a robust version using a wrapper function in extrantsr, fslbet_robust.

+
+

+Data Packages

+

For this analysis, I will use one subject from the Kirby 21 data set. The kirby21.base and kirby21.t1 packages are necessary for this analysis and have the data we will be working on. You need devtools to install these. Please refer to installing devtools for additional instructions or troubleshooting.

+
packages = installed.packages()
+packages = packages[, "Package"]
+if (!"kirby21.t1" %in% packages) {
+  devtools::install_github("muschellij2/kirby21.t1")
+}
+
+

+Loading Data

+

We will use the get_image_filenames_df function to extract the filenames on our hard disk for the T1 image.

+
library(kirby21.t1)
+t1_fname = get_t1_filenames(
+  ids = 113,
+  visits = 1)
+if (is.null(t1_fname)) {
+  dl = TRUE
+} else {
+  dl = !file.exists(t1_fname)
+}
+if (dl) {
+  url = paste0("https://raw.githubusercontent.com/muschellij2/kirby21.t1", "/master/inst/visit_1/113/113-01-T1.nii.gz")
+  t1_fname = tempfile(fileext = ".nii.gz")
+  download.file(url, t1_fname)
+}
+
+
+
+

+T1 image

+

Let’s take a look at the T1-weighted image.

+
t1 = readnii(t1_fname)
+ortho2(t1)
+

+

Here we see the brain and other parts of the image are present. Most notably, the neck of the subject was imaged. Sometimes this can cause problems with segmentation and image registration.

+
+
+

+Attempt 1: Brain Extraction of T1 image using BET

+

Here we will use FSL’s Brain Extraction Tool (BET) to extract the brain tissue from the rest of the image.

+
if (have.fsl()) {
+  ss_naive = fslbet(infile = t1_fname)
+}
+
bet2 "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file79775059eaca.nii.gz" "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file797759147a60" 
+
if (have.fsl()) {
+  ortho2(ss_naive)
+}
+

+

We see that naively, BET does not perform well for this image.

+
+
+

+Brain Extraction of T1 image using BET

+

Here we will use FSL’s Brain Extraction Tool (BET) to extract the brain tissue from the rest of the image. We use the modification of BET in extrantsr, which is called through fslbet_robust. In fslbet_robust, the image is corrected using the N4 inhomogeneity correction. The neck of the T1 image is then removed and then BET is run, the center of gravity (COG) is estimated, and BET is run with this new COG. We used a procedure where the neck is removed in 2 registration steps, which is more robust than just the one (which is the default).

+

We will do the bias correction explicitly here:

+
n4img = bias_correct(
+  t1_fname,
+  correction = "N4",
+  retimg = FALSE,
+  outfile = tempfile(fileext = ".nii.gz"),
+  verbose = FALSE)
+if (have.fsl()) {
+  template.file = fslr::mni_fname(brain = TRUE)
+  template.mask = fslr::mni_fname(brain = TRUE, mask = TRUE)
+  removed_neck = extrantsr::double_remove_neck(
+    n4img,
+    template.file = template.file,
+    template.mask = template.mask)
+  ortho2(removed_neck)
+  double_ortho(t1, removed_neck)
+}
+
# Registration to template
+
# Swapping Dimensions 
+
fslhd "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file79772836aba.nii.gz" 
+
fslorient -getorient "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file79772836aba.nii.gz"
+
fslswapdim "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file79772836aba.nii.gz"  RL PA IS "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file79777bb63f4f";
+
# Running Registration of file to template
+
# Applying Registration output is
+
$warpedmovout
+antsImage
+  Pixel Type          : float 
+  Components Per Pixel: 1 
+  Dimensions          : 170x256x256 
+  Voxel Spacing       : 1.20000004768372x1x1 
+  Origin              : 0 255 0 
+  Direction           : 1 0 0 0 -1 0 0 0 1 
+
+
+$warpedfixout
+antsImage
+  Pixel Type          : float 
+  Components Per Pixel: 1 
+  Dimensions          : 182x218x182 
+  Voxel Spacing       : 1x1x1 
+  Origin              : -90 126 -72 
+  Direction           : 1 0 0 0 -1 0 0 0 1 
+
+
+$fwdtransforms
+[1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file79772d3954f20GenericAffine.mat"
+
+$invtransforms
+[1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file79772d3954f20GenericAffine.mat"
+
+$prev_transforms
+character(0)
+
# Applying Transformations to file
+
# Applying Transforms to other.files
+
# Writing out file
+
# Writing out other.files
+
# Removing Warping images
+
# Reading data back into R
+
# Reading in Transformed data
+
# Dropping slices not in mask
+
# Swapping Dimensions Back
+
fslswapdim "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file797775d57de0.nii.gz"  LR AP IS "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file7977133b3990";
+
# Registration to template
+
# Swapping Dimensions 
+
fslhd "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file7977154026cd.nii.gz" 
+
fslorient -getorient "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file7977154026cd.nii.gz"
+
fslswapdim "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file7977154026cd.nii.gz"  RL PA IS "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file79774c588ee0";
+
# Running Registration of file to template
+
# Applying Registration output is
+
$warpedmovout
+antsImage
+  Pixel Type          : float 
+  Components Per Pixel: 1 
+  Dimensions          : 170x256x256 
+  Voxel Spacing       : 1.20000004768372x1x1 
+  Origin              : 0 255 0 
+  Direction           : 1 0 0 0 -1 0 0 0 1 
+
+
+$warpedfixout
+antsImage
+  Pixel Type          : float 
+  Components Per Pixel: 1 
+  Dimensions          : 182x218x182 
+  Voxel Spacing       : 1x1x1 
+  Origin              : -90 126 -72 
+  Direction           : 1 0 0 0 -1 0 0 0 1 
+
+
+$fwdtransforms
+[1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file7977690819f20GenericAffine.mat"
+
+$invtransforms
+[1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file7977690819f20GenericAffine.mat"
+
+$prev_transforms
+character(0)
+
# Applying Transformations to file
+
# Applying Transforms to other.files
+
# Writing out file
+
# Writing out other.files
+
# Removing Warping images
+
# Reading data back into R
+
# Reading in Transformed data
+
# Dropping slices not in mask
+
# Swapping Dimensions Back
+
fslswapdim "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpoO1dC0/file797714a76102.nii.gz"  LR AP IS "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpoO1dC0/file797778d1d4e5";
+

+

Let’s look at the skull-stripped image after doing all these steps.

+
if (have.fsl()) {
+  ss = extrantsr::fslbet_robust(t1_fname,
+    remover = "double_remove_neck", recog = FALSE)
+  ortho2(ss)
+}
+

+

Here we see the skull-stripped image. But did we drop out “brain areas”?

+
if (have.fsl()) {
+  alpha = function(col, alpha = 1) {
+    cols = t(col2rgb(col, alpha = FALSE)/255)
+    rgb(cols, alpha = alpha)
+  }
+  ortho2(t1, ss > 0, col.y = alpha("red", 0.5))
+}
+

+

We can again use dropEmptyImageDimensions to remove extraneous slices, which helps with reducing storage of the image on disk, zooming in while plotting, and may aid registration.

+
if (have.fsl()) {
+  ss_red = dropEmptyImageDimensions(ss)
+  ortho2(ss_red)
+}
+

+

Again, we can see the zoomed-in view of the image now.

+
+
+ + + +
+ + + + +
+ + + + + + diff --git a/docs/articles/brain_extract_files/figure-html/t1_naive_plot-1.png b/docs/articles/brain_extract_files/figure-html/t1_naive_plot-1.png new file mode 100644 index 0000000..8acc561 Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_naive_plot-1.png differ diff --git a/docs/articles/brain_extract_files/figure-html/t1_plot-1.png b/docs/articles/brain_extract_files/figure-html/t1_plot-1.png new file mode 100644 index 0000000..bde654b Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_plot-1.png differ diff --git a/docs/articles/brain_extract_files/figure-html/t1_ss-1.png b/docs/articles/brain_extract_files/figure-html/t1_ss-1.png new file mode 100644 index 0000000..41fc14d Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_ss-1.png differ diff --git a/docs/articles/brain_extract_files/figure-html/t1_ss-2.png b/docs/articles/brain_extract_files/figure-html/t1_ss-2.png new file mode 100644 index 0000000..03ecdf3 Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_ss-2.png differ diff --git a/docs/articles/brain_extract_files/figure-html/t1_ss_plot2-1.png b/docs/articles/brain_extract_files/figure-html/t1_ss_plot2-1.png new file mode 100644 index 0000000..d5317a9 Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_ss_plot2-1.png differ diff --git a/docs/articles/brain_extract_files/figure-html/t1_ss_red-1.png b/docs/articles/brain_extract_files/figure-html/t1_ss_red-1.png new file mode 100644 index 0000000..0de07a8 Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/t1_ss_red-1.png differ diff --git a/docs/articles/brain_extract_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/brain_extract_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..7904f85 Binary files /dev/null and b/docs/articles/brain_extract_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/brain_extract_files/header-attrs-2.1.3/header-attrs.js b/docs/articles/brain_extract_files/header-attrs-2.1.3/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/brain_extract_files/header-attrs-2.1.3/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/index.html b/docs/articles/index.html new file mode 100644 index 0000000..6226a0b --- /dev/null +++ b/docs/articles/index.html @@ -0,0 +1,156 @@ + + + + + + + + +Articles • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

All vignettes

+

+ +
+
Brain Extraction and Segmentation
+
+
+
+
+
+ + + +
+ + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..b75e37a --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,156 @@ + + + + + + + + +Authors • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
    +
  • +

    John Muschelli. Author, maintainer. +

    +
  • +
+ +
+ +
+ + + + +
+ + + + + + + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..5bcf581 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,141 @@ + + + + + + + +Extra Functions to Build on the ANTsR Package • extrantsr + + + + + + + + + + +
    +
    + + + + +
    +
    +
    + +

    The goal of extrantsr is to build on the ANTsR Package.

    +

    Travis-CI Build Status AppVeyor Build Status Coverage Status

    +
    +

    +Installation

    +

    You can install extrantsr from github with:

    +
    # install.packages("devtools")
    +devtools::install_github("muschellij2/extrantsr")
    +
    +
    +
    + + +
    + + +
    + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..c01e592 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,367 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +img { + max-width: 100%; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + margin-left: -30px; + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top;} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} + +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + +pre .img { + margin: 5px 0; +} + +pre .img img { + background-color: #fff; + display: block; + height: auto; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..7e7048f --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..4380c06 --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 2.9.2 +pkgdown: 1.5.1 +pkgdown_sha: ~ +articles: + brain_extract: brain_extract.html +last_built: 2020-05-19T20:16Z + diff --git a/docs/reference/accessor-methods.html b/docs/reference/accessor-methods.html new file mode 100644 index 0000000..4170778 --- /dev/null +++ b/docs/reference/accessor-methods.html @@ -0,0 +1,191 @@ + + + + + + + + +Extract Image Attributes <code>origin</code> from <code>antsImage</code> or <code>nifti</code> +objects — origin • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Methods that act on the slots of the +antsImage or nifti object

    +
    + +
    origin(object)
    +
    +# S4 method for antsImage
    +origin(object)
    +
    +origin(object) <- value
    +
    +# S4 method for antsImage
    +origin(object) <- value
    +
    +# S4 method for anlz
    +origin(object) <- value
    + +

    Arguments

    + + + + + + + + + + +
    object

    is an object of class antsImage or nifti.

    value

    is the value to assign to the slot.

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants.extract.html b/docs/reference/ants.extract.html new file mode 100644 index 0000000..2d89076 --- /dev/null +++ b/docs/reference/ants.extract.html @@ -0,0 +1,180 @@ + + + + + + + + +Extract values from antsImage from mask — ants.extract • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Just helpful wrapper to convert to array and then take +values for which mask is 1

    +
    + +
    ants.extract(img, mask)
    + +

    Arguments

    + + + + + + + + + + +
    img

    image either in array or class antsImage

    mask

    binary image either in array or class antsImage

    + +

    Value

    + +

    Numeric vector

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants.overlay.html b/docs/reference/ants.overlay.html new file mode 100644 index 0000000..330c42d --- /dev/null +++ b/docs/reference/ants.overlay.html @@ -0,0 +1,198 @@ + + + + + + + + +Plot Lightbox for antsImage — ants.overlay • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Plots series of Images for slices of antsImage

    +
    + +
    ants.overlay(
    +  img,
    +  oimg,
    +  slices = 53,
    +  col.x = gray(0:64/64),
    +  col.y = "#FF0000FF",
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Image to be plotted

    oimg

    image to be overlaid

    slices

    slice to be displayed

    col.x

    grayscale coloring for img

    col.y

    color for overlay

    ...

    arguments to be passed to image

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants2oro.html b/docs/reference/ants2oro.html new file mode 100644 index 0000000..fb65409 --- /dev/null +++ b/docs/reference/ants2oro.html @@ -0,0 +1,206 @@ + + + + + + + + +Convert Between antsImage and nifti objects — ants2oro • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    NIfTI data can be converted between antsImage +(from the ANTsR package) and nifti S4 objects.

    +
    + +
    ants2oro(
    +  img,
    +  reorient = FALSE,
    +  reference = NULL,
    +  ...,
    +  cleanup = TRUE,
    +  drop_dim = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class antsImage

    reorient

    Reorientation passed to readnii

    reference

    Object of class nifti to copy header +information

    ...

    Arguments passed to copyNIfTIHeader if +reference is set and img is antsImage

    cleanup

    temporary files are deleted after they are read in

    drop_dim

    Should drop_img_dim be run after reading? +Passed to readnii

    + +

    Value

    + +

    Object of class nifti.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/antsCopy.html b/docs/reference/antsCopy.html new file mode 100644 index 0000000..c726216 --- /dev/null +++ b/docs/reference/antsCopy.html @@ -0,0 +1,199 @@ + + + + + + + + +Copy Information of One Image to Another — antsCopy • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wraps antsSetOrigin/antsSetDirection/antsSetSpacing +and antsGetOrigin/antsGetDirection/antsGetSpacing +to copy the information over. Finer control than +antsCopyImageInfo

    +
    + +
    antsCopyOrigin(reference, target)
    +
    +antsCopyDirection(reference, target)
    +
    +antsCopySpacing(reference, target)
    + +

    Arguments

    + + + + + + + + + + +
    reference

    antsImage object to get origin values from

    target

    antsImage object to copy origin values to

    + +

    Value

    + +

    target object of class antsImage

    + +

    Examples

    +
    library(ANTsR)
    #> Loading required package: ANTsRCore
    #> +#> Attaching package: ‘ANTsRCore’
    #> The following objects are masked from ‘package:extrantsr’: +#> +#> origin, origin<-
    #> The following objects are masked from ‘package:stats’: +#> +#> sd, var
    #> The following objects are masked from ‘package:base’: +#> +#> all, any, apply, max, min, prod, range, sum
    img <- makeImage(c(10,10),rnorm(100)) +img2 <- makeImage(c(10,10), rnorm(100)) +img2 <- antsCopyOrigin(img, img2)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants_apply_transforms-methods.html b/docs/reference/ants_apply_transforms-methods.html new file mode 100644 index 0000000..52a9395 --- /dev/null +++ b/docs/reference/ants_apply_transforms-methods.html @@ -0,0 +1,206 @@ + + + + + + + + +Apply ANTs transforms to nifti images — ants_apply_transforms-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wraps antsApplyTransforms but allows for +nifti objects from the oro.nifti package

    +
    + +
    ants_apply_transforms(fixed, moving, transformlist, ...)
    +
    +# S4 method for ANY,list
    +ants_apply_transforms(fixed, moving, transformlist, ret_ants = FALSE, ...)
    +
    +# S4 method for ANY,character
    +ants_apply_transforms(fixed, moving, transformlist, ret_ants = FALSE, ...)
    +
    +# S4 method for ANY,ANY
    +ants_apply_transforms(fixed, moving, transformlist, ret_ants = FALSE, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    fixed

    image defining domain into which the moving image is transformed.

    moving

    image to be mapped to fixed space.

    transformlist

    character vector of transforms generated by +antsRegistration

    ...

    Arguments to be passed to antsApplyTransforms.

    ret_ants

    if TRUE, the returned object is an antsImage, +as opposed to a nifti

    + +

    Value

    + +

    Either nifti object or list of nifti objects

    +

    See also

    + +

    antsApplyTransforms

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants_bwlabel.html b/docs/reference/ants_bwlabel.html new file mode 100644 index 0000000..7dc5578 --- /dev/null +++ b/docs/reference/ants_bwlabel.html @@ -0,0 +1,182 @@ + + + + + + + + +ANTs BWLabel Clusters of Certain Size — ants_bwlabel • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get Cluster of certain size from labelClusters

    +
    + +
    ants_bwlabel(img, k = 1, binary = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    input image

    k

    Minimum cluster size needed

    binary

    (logical) Should the result be binary or numbered with cluster.

    + +

    Value

    + +

    nifti object

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ants_regwrite.html b/docs/reference/ants_regwrite.html new file mode 100644 index 0000000..d04ffba --- /dev/null +++ b/docs/reference/ants_regwrite.html @@ -0,0 +1,301 @@ + + + + + + + + +Registration to a Template — ants_regwrite • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a template +using ANTsR and SyN transformation, carry out the transformation +on other images, and can back-transform atlases +in template space to the native space of the iimage

    +
    + +
    ants_regwrite(
    +  filename,
    +  skull_strip = FALSE,
    +  correct = FALSE,
    +  correction = "N3",
    +  retimg = TRUE,
    +  outfile = NULL,
    +  template.file = file.path(fsldir(), "data", "standard", "MNI152_T1_1mm_brain.nii.gz"),
    +  interpolator = "Linear",
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  native.cereb = FALSE,
    +  native.fname = NULL,
    +  atlas.file = NULL,
    +  typeofTransform = "SyN",
    +  remove.warp = TRUE,
    +  outprefix = NULL,
    +  bet.opts = "-B -f 0.1 -v",
    +  betcmd = "bet",
    +  verbose = TRUE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    filename

    filename of T1 image

    skull_strip

    do skull stripping with FSL BET

    correct

    do Bias correction

    correction

    N3 or N4 correction, see bias_correct

    retimg

    return a nifti object from function

    outfile

    output filename should have .nii or .nii.gz +extension

    template.file

    Filename of template to warp to

    interpolator

    interpolation done for +antsApplyTransforms

    other.files

    Filenames of other iamges to be +transformed with the T1

    other.outfiles

    Output filenames of other.files to +be written

    native.cereb

    Logical indicating if native cerebellum should be +created to native.fname

    native.fname

    filename of native cerebellum file

    atlas.file

    Filename of atlas used for warping labels

    typeofTransform

    type of transformed used, passed to +antsRegistration

    remove.warp

    (logical) Should warping images be deleted?

    outprefix

    Character path of where the warp files should be stored. +Required if remove.warp = FALSE

    bet.opts

    Options passed to fslbet

    betcmd

    BET command used, passed to fslbet

    verbose

    Print diagnostic messages

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to antsRegistration

    + +

    Value

    + +

    NULL or object of class nifti for transformed T1 image

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/applyEmptyImageDimensions-methods.html b/docs/reference/applyEmptyImageDimensions-methods.html new file mode 100644 index 0000000..466cb81 --- /dev/null +++ b/docs/reference/applyEmptyImageDimensions-methods.html @@ -0,0 +1,191 @@ + + + + + + + + +Apply Subsetting from Empty Image Dimensions — applyEmptyImageDimensions,antsImage-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple wrapper for subsetting an image with indices, +dropping empty dimensions.

    +
    + +
    # S4 method for antsImage
    +applyEmptyImageDimensions(img, inds, reorient = FALSE, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    img

    image, nifti object, or array

    inds

    indices of subset from getEmptyImageDimensions or +dropEmptyImageDimensions.

    reorient

    Should image be reoriented if a filename

    ...

    not used

    + +

    Value

    + +

    Object of class nifti or array if nifti +is not supplied

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/apply_malf_regs.html b/docs/reference/apply_malf_regs.html new file mode 100644 index 0000000..e349af2 --- /dev/null +++ b/docs/reference/apply_malf_regs.html @@ -0,0 +1,229 @@ + + + + + + + + +Apply MALF Registrations — apply_malf_regs • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes in an input file, set of registrations, +and a set of template structures and applies the registrations, +with a different interpolator if necessary

    +
    + +
    apply_malf_regs(
    +  infile,
    +  regs,
    +  template.structs,
    +  keep_images = TRUE,
    +  outfiles = NULL,
    +  inverted = FALSE,
    +  interpolator = NULL,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    infile

    Input Image file

    regs

    List of registrations from malf or +malf_registration, each element must have +fwdtransforms and interpolator. Same length as +template.structs

    template.structs

    Template gold standards to apply +registration into infile space

    keep_images

    Keep the template.structs in +infile space

    outfiles

    Output filenames for template.structs in +infile space

    inverted

    Should the MALF be inverted (inverse transforms are used +instead of forward)

    interpolator

    interpolation done for +antsApplyTransforms, can be different than original MALF

    verbose

    Print diagnostic output

    ...

    Arguments to be passed to ants_apply_transforms

    + +

    Value

    + +

    The output filename or the nifti image or list of registrations and +output file

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/apply_multi_reg-methods.html b/docs/reference/apply_multi_reg-methods.html new file mode 100644 index 0000000..8a33471 --- /dev/null +++ b/docs/reference/apply_multi_reg-methods.html @@ -0,0 +1,205 @@ + + + + + + + + +Check if antsImage or read in — apply_multi_reg-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple check to see if input is character, list, nifti, +or class antsImage

    +
    + +
    apply_multi_reg(infiles, transformlist, fixed, ...)
    +
    +# S4 method for list,list
    +apply_multi_reg(infiles, transformlist, fixed, ...)
    +
    +# S4 method for character,list
    +apply_multi_reg(infiles, transformlist, fixed, ...)
    +
    +# S4 method for antsImage,character
    +apply_multi_reg(infiles, transformlist, fixed, ...)
    +
    +# S4 method for nifti,character
    +apply_multi_reg(infiles, transformlist, fixed, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    infiles

    Input image files

    transformlist

    list or character vector of transforms generated +by antsRegistration where each transform is a filename.

    fixed

    fixed image defining domain into which the infiles image +is transformed

    ...

    Arguments passed to antsApplyTransforms

    + +

    Value

    + +

    Object of class nifti

    +

    See also

    + +

    antsApplyTransforms

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/bias_correct.html b/docs/reference/bias_correct.html new file mode 100644 index 0000000..86e9c40 --- /dev/null +++ b/docs/reference/bias_correct.html @@ -0,0 +1,232 @@ + + + + + + + + +N3 or N4 Correct — bias_correct • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps ANTsR bias field corrections and returns +nifti objects

    +
    + +
    bias_correct(
    +  file,
    +  correction = c("N3", "N4", "n3", "n4"),
    +  outfile = NULL,
    +  retimg = TRUE,
    +  reorient = FALSE,
    +  shrinkfactor = "4",
    +  mask = NULL,
    +  verbose = TRUE,
    +  ...
    +)
    +
    +bias_correct_ants(
    +  file,
    +  correction = c("N3", "N4", "n3", "n4"),
    +  shrinkfactor = "4",
    +  mask = NULL,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    (character) image to be manipulated

    correction

    (character) N3 or N4 correction?

    outfile

    (character) resultant image name (optional)

    retimg

    (logical) return image of class nifti

    reorient

    (logical) If retimg, should file be reoriented when read in? +Passed to readnii.

    shrinkfactor

    Shrink factor passed to +n3BiasFieldCorrection

    mask

    Mask to pass to n4BiasFieldCorrection

    verbose

    print diagnostic output.

    ...

    additional arguments passed to +n3BiasFieldCorrection or + n4BiasFieldCorrection

    + +

    Value

    + +

    If retimg then object of class nifti. Otherwise, +Result from system command, depends if intern is TRUE or FALSE.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/bias_ss.html b/docs/reference/bias_ss.html new file mode 100644 index 0000000..f142791 --- /dev/null +++ b/docs/reference/bias_ss.html @@ -0,0 +1,242 @@ + + + + + + + + +Bias Field Correct then Skull Strip — bias_ss • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps fslbet and +bias_correct, performing bias correction first

    +
    + +
    bias_ss(
    +  filename,
    +  maskfile = NULL,
    +  outfile = tempfile(fileext = ".nii.gz"),
    +  skull_strip = TRUE,
    +  bet.opts = "",
    +  betcmd = "bet",
    +  correct = TRUE,
    +  correction = "N3",
    +  shrinkfactor = "4",
    +  retimg = TRUE,
    +  reorient = FALSE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    filename

    filename to be processed

    maskfile

    filename of masked to be passed in, otherwise bet is performed

    outfile

    output filename with extension (e.g. .nii.gz)s

    skull_strip

    should skull stripping be done

    bet.opts

    options for fslbet

    betcmd

    bet command to be used see fslbet

    correct

    should n3 correction be done stripping be done

    correction

    correction method used see bias_correct

    shrinkfactor

    correction method used see n3BiasFieldCorrection

    retimg

    (logical) return image of class nifti

    reorient

    (logical) If retimg, should file be reoriented when read in? +Passed to readnii.

    verbose

    Diagnostic output

    ...

    passed to bias_correct

    + +

    Value

    + +

    Filename of output file or object of class nifti

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/brain_extract.html b/docs/reference/brain_extract.html new file mode 100644 index 0000000..84159bb --- /dev/null +++ b/docs/reference/brain_extract.html @@ -0,0 +1,222 @@ + + + + + + + + +Wrapper for ANTs brain extraction — brain_extract • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps abpN4 and +abpBrainExtraction for nifti images with additional checks

    +
    + +
    brain_extract(
    +  img,
    +  template,
    +  template.mask,
    +  typeofTransform = c("SyNabp", "SyN"),
    +  correct = TRUE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Image for brain extraction, nifti, character or antsImage

    template

    Template image with mask, nifti, character or antsImage

    template.mask

    Template brain mask

    typeofTransform

    registration type: 'SyNabp' (better, slower), +'SyN' (fast)

    correct

    Should abpN4 be performed first?

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    additional arguments passed to abpBrainExtraction

    + +

    Value

    + +

    A list of the brain image, brain mask, k-means segmentation, +and transformations.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/c3d.html b/docs/reference/c3d.html new file mode 100644 index 0000000..ae38a70 --- /dev/null +++ b/docs/reference/c3d.html @@ -0,0 +1,188 @@ + + + + + + + + +Convert NeuroImage Types — c3d • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple wrapper for antsImageRead and +antsImageWrite for conversion of image file types. +For example, NRRD files with nhdr/raw file formats can be converted to +.nii.gz.

    +
    + +
    c3d(infile, outfile, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    infile

    input filename

    outfile

    output filename with extension

    ...

    arguments to be passed to antsImageRead

    + +

    Value

    + +

    Output from antsImageWrite

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/check_ants-methods.html b/docs/reference/check_ants-methods.html new file mode 100644 index 0000000..d828df5 --- /dev/null +++ b/docs/reference/check_ants-methods.html @@ -0,0 +1,182 @@ + + + + + + + + +Check if antsImage or read in — check_ants,nifti-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple check to see if input is character, list, nifti, +or class antsImage

    +
    + +
    # S4 method for nifti
    +check_ants(x, ...)
    + +

    Arguments

    + + + + + + + + + + +
    x

    character path of image or +an object of class antsImage

    ...

    arguments passed to oro2ants

    + +

    Value

    + +

    antsImage object

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/check_nifti-methods.html b/docs/reference/check_nifti-methods.html new file mode 100644 index 0000000..04f26f0 --- /dev/null +++ b/docs/reference/check_nifti-methods.html @@ -0,0 +1,214 @@ + + + + + + + + +Check if nifti image or read in a nifti image — check_nifti,antsImage-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple check to see if input is character or of +class nifti

    +
    + +
    # S4 method for antsImage
    +check_nifti(
    +  x,
    +  reorient = FALSE,
    +  allow.array = FALSE,
    +  fast = FALSE,
    +  need_header = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    x

    character path of image or +an object of class nifti, or array

    reorient

    (logical) passed to readnii +if the image +is to be re-oriented

    allow.array

    (logical) Are array types allowed (TRUE) or +should there be an error if the object is not character or class +nifti.

    fast

    not used for antsImage classes

    need_header

    if TRUE, then an image type with header information +will be returned. If not, then an array is fine. Used really only in +conjunction with allow.array

    ...

    additional options to pass to ants2oro

    + +

    Value

    + +

    nifti object or array if allow.array=TRUE and x is an array

    +

    See also

    + +

    readnii

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/checkimg-methods.html b/docs/reference/checkimg-methods.html new file mode 100644 index 0000000..f42efa3 --- /dev/null +++ b/docs/reference/checkimg-methods.html @@ -0,0 +1,182 @@ + + + + + + + + +Force object to filename — checkimg-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Ensures the output to be a character filename (or vector) from an input +image or nifti.

    +
    + +
    # S4 method for antsImage
    +checkimg(file, allow_array = FALSE, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    file

    character or antsImage object

    allow_array

    allow arrays to be passed in

    ...

    options passed to tempimg

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/compose_transform_to_file.html b/docs/reference/compose_transform_to_file.html new file mode 100644 index 0000000..72c5e04 --- /dev/null +++ b/docs/reference/compose_transform_to_file.html @@ -0,0 +1,207 @@ + + + + + + + + +Compose Transforms from ANTsR to a composite file — compose_transform_to_file • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This is a thin wrapper for antsApplyTransforms but +is specifically for composing a transform and getting a file out.

    +
    + +
    compose_transform_to_file(
    +  fixed,
    +  moving,
    +  transformlist = NULL,
    +  output_prefix = NULL
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    fixed

    fixed image defining domain into which the moving image is transformed.

    moving

    moving image to be mapped to fixed space.

    transformlist

    haracter vector of transforms generated by +antsRegistration where each transform is a filename.

    output_prefix

    Prefix of output filename to return. The prefix will +add comptx.nii.gz to the end

    + +

    Value

    + +

    A character filename

    + +

    Examples

    +
    library(ANTsR) +fixed <- antsImageRead( getANTsRData("r16") ,2) +moving <- antsImageRead( getANTsRData("r64") ,2) +fixed <- resampleImage(fixed,c(64,64),1,0) +moving <- resampleImage(moving,c(64,64),1,0) +mytx <- antsRegistration(fixed=fixed , moving=moving , + typeofTransform = c("SyN"), + verbose = TRUE + ) +composed <- compose_transform_to_file( +fixed=fixed, moving=moving, transformlist=mytx$fwdtransforms)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/corr_img.html b/docs/reference/corr_img.html new file mode 100644 index 0000000..9e2bd64 --- /dev/null +++ b/docs/reference/corr_img.html @@ -0,0 +1,211 @@ + + + + + + + + +Neighborhood Correlation Image — corr_img • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Calculates the neighborhood of 2 registered images, and then +does the correlation of each neighbor with itself in the other imaging modality

    +
    + +
    corr_img(
    +  img1,
    +  img2,
    +  mask = NULL,
    +  radius = rep(1, 3),
    +  method = c("pearson", "spearman"),
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img1

    image of class nifti, antsImage, character

    img2

    image of class nifti, antsImage, character

    mask

    Binary image of class nifti, +antsImage, character. Only neighborhoods inside the mask +will be taken

    radius

    vector of length 3 for number of voxels to go in each direction. +Default is 27 neighbors (including voxel at center). +Passed to getNeighborhoodInMask.

    method

    Type of correlation.

    verbose

    print diagnostic messages

    + +

    Value

    + +

    Object of class nifti

    + +

    Examples

    +
    if (FALSE) { +corr_img("T1_Image.nii.gz", "FLAIR_Image.nii.gz", mask = "Mask.nii.gz") +}
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/cort_thickness.html b/docs/reference/cort_thickness.html new file mode 100644 index 0000000..e5fd7fc --- /dev/null +++ b/docs/reference/cort_thickness.html @@ -0,0 +1,190 @@ + + + + + + + + +Compute cortical thickness using Kelly Kapowski (ANTsR) — cort_thickness • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wrapper for the kellyKapowski function +in ANTsR, that computes cortical thickness.

    +
    + +
    cort_thickness(seg, gray, white, ...)
    +
    +kk(seg, gray, white, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    seg

    segmentation image

    gray

    gray matter probability image

    white

    white matter probability image

    ...

    arguments passed to kellyKapowski

    + +

    Value

    + +

    Object of class nifti.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/create_moment.html b/docs/reference/create_moment.html new file mode 100644 index 0000000..366f267 --- /dev/null +++ b/docs/reference/create_moment.html @@ -0,0 +1,207 @@ + + + + + + + + +Create Neighborhood Momemts of an Image — create_moment • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Creates first (mean) through fourth (kurtosis) central moments, +as well as gradients and mean/sd image.

    +
    + +
    create_moment(
    +  img,
    +  mask = NULL,
    +  radius = rep(1, 3),
    +  retimg = TRUE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti, character or antsImage

    mask

    Object of class nifti, character or antsImage. +Only neighborhoods inside the mask will be taken. If NULL, all +neighbors of the image will be taken

    radius

    array of values for neighborhood radius (in voxels)

    retimg

    Should images (of class nifti) be returned or should +a matrix

    verbose

    print diagnostic messages

    ...

    arguments to passed to neighborhood

    + +

    Value

    + +

    List of images (of class nifti) or +a matrix (V by 6), where V is the number of voxels in the mask

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/diff_self.html b/docs/reference/diff_self.html new file mode 100644 index 0000000..3aa155d --- /dev/null +++ b/docs/reference/diff_self.html @@ -0,0 +1,200 @@ + + + + + + + + +Flipped Difference Image — diff_self • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function flips the image over the left/right axis, then registers +the flipped image to the original image and then takes a difference

    +
    + +
    diff_self(img, swapdim = TRUE, verbose = TRUE, reproducible = TRUE, seed = 1)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti, ANTsR, or character

    swapdim

    Should the image be reoriented to RPI then flipped, registered, +then changed back?

    verbose

    Print diagnostic messages

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/double_remove_neck.html b/docs/reference/double_remove_neck.html new file mode 100644 index 0000000..ebf7aaa --- /dev/null +++ b/docs/reference/double_remove_neck.html @@ -0,0 +1,224 @@ + + + + + + + + +Remove Neck Twice from a Scan — double_remove_neck • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wrapper for running remove_neck twice, as some images +require this if large number of slices of the neck or upper shoulders +were scanned

    +
    + +
    double_remove_neck(
    +  file,
    +  template.file,
    +  template.mask,
    +  typeofTransform = "Rigid",
    +  rep.value = 0,
    +  swapdim = TRUE,
    +  verbose = TRUE,
    +  ret_mask = FALSE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    File for neck removal - either filename or class nifti

    template.file

    Template to warp to original image space

    template.mask

    Mask of template to use as rough brain mask. If +template.file is specified, but template.mask is not, +then fslbin(file=template.file) is performed.

    typeofTransform

    Transformation for template to image, passed to +ants_regwrite.

    rep.value

    Value to replace neck slices with

    swapdim

    Should the dimensions be swapped before registration, +and then reset after

    verbose

    Print out diagnostic messages

    ret_mask

    Should the mask be returned vs. the image?

    ...

    Additional arguments passed to remove_neck

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/emptyImageDimensionsMask-methods.html b/docs/reference/emptyImageDimensionsMask-methods.html new file mode 100644 index 0000000..8e75989 --- /dev/null +++ b/docs/reference/emptyImageDimensionsMask-methods.html @@ -0,0 +1,192 @@ + + + + + + + + +Make Mask from Empty Image Dimensions — emptyImageDimensionsMask • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Make a mask of an image that has all irrelevant +values

    +
    + +
    # S4 method for antsImage
    +emptyImageDimensionsMask(img, ..., reorient = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    nifti object

    ...

    Arguments to be passed to getEmptyImageDimensions.

    reorient

    Should image be reoriented if a filename?

    + +

    Value

    + +

    Object of class nifti, with binary values

    +

    Note

    + +

    empty_dim_mask is a shorthand for emptyImageDimensionsMask +with all the same arguments.qQac vgfrew

    +

    See also

    + +

    getEmptyImageDimensions

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/face_removal_mask_ants.html b/docs/reference/face_removal_mask_ants.html new file mode 100644 index 0000000..29ab315 --- /dev/null +++ b/docs/reference/face_removal_mask_ants.html @@ -0,0 +1,221 @@ + + + + + + + + +Face Removal Mask using ANTs Registration — face_removal_mask_ants • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Face Removal Mask using ANTs Registration

    +
    + +
    face_removal_mask_ants(
    +  file,
    +  template = NULL,
    +  face_mask = NULL,
    +  outfile = NULL,
    +  ...,
    +  retimg = FALSE
    +)
    +
    +deface_image_ants(file, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    input image

    template

    Template image to register input image to. Set +to NULL (recommended) if want to use from +https://github.com/poldracklab/pydeface. +Alternatively, use mni_fname.

    face_mask

    Mask of image, in same space as template. +Set to NULL (recommended) if want to use from +https://github.com/poldracklab/pydeface. +Alternatively, use mni_face_fname from fsl.

    outfile

    Output file name

    ...

    additional arguments to pass to +registration

    retimg

    (logical) return image of class nifti

    + +

    Value

    + +

    An image or filename depending on retimg

    + +

    Examples

    +
    # \donttest{ +if (fslr::have_fsl()) { + file = "~/Downloads/sample_T1_input.nii.gz" + if (file.exists(file)) { + mask = face_removal_mask_ants(file = file, + template = NULL, face_mask = NULL) + image = mask_img(file, mask) + } +} +# }
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/fill_2d_z.html b/docs/reference/fill_2d_z.html new file mode 100644 index 0000000..0150973 --- /dev/null +++ b/docs/reference/fill_2d_z.html @@ -0,0 +1,194 @@ + + + + + + + + +Image Mask Filler over each slice in Z-direction — fill_2d_z • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Fills in a binary image using iMath, +using dilation erosion but with zero padding built in.

    +
    + +
    fill_2d_z(img, fill_size = 7, verbose = TRUE, dilate = TRUE, erode = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti or antsImage

    fill_size

    Size of fill (in voxels)

    verbose

    Output diagnostic values

    dilate

    should the image be dilated. This and erode +allows for the function to perform erosion/dilation only with zero-padding.

    erode

    should the image be eroded This and dilate +allows for the function to perform erosion/dilation only with zero-padding.

    + +

    Value

    + +

    Filled object with same class as img

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/filler.html b/docs/reference/filler.html new file mode 100644 index 0000000..33cec2a --- /dev/null +++ b/docs/reference/filler.html @@ -0,0 +1,194 @@ + + + + + + + + +Image Mask Filler — filler • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Fills in a binary image using iMath, +using dilation erosion but with zero padding built in.

    +
    + +
    filler(img, fill_size = 7, verbose = TRUE, dilate = TRUE, erode = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti or antsImage

    fill_size

    Size of fill (in voxels)

    verbose

    Output diagnostic values

    dilate

    should the image be dilated. This and erode +allows for the function to perform erosion/dilation only with zero-padding.

    erode

    should the image be eroded This and dilate +allows for the function to perform erosion/dilation only with zero-padding.

    + +

    Value

    + +

    Filled object with same class as img

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/finite_img-methods.html b/docs/reference/finite_img-methods.html new file mode 100644 index 0000000..4bfd0bf --- /dev/null +++ b/docs/reference/finite_img-methods.html @@ -0,0 +1,180 @@ + + + + + + + + +Finite Image — finite_img-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple wrapper for setting non-finite values to zero

    +
    + +
    # S4 method for antsImage
    +finite_img(img, replace = 0)
    + +

    Arguments

    + + + + + + + + + + +
    img

    character path of image or +an object of class nifti, or list of images

    replace

    Value to replace non-finite values to

    + +

    Value

    + +

    image object

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/fslbet_robust.html b/docs/reference/fslbet_robust.html new file mode 100644 index 0000000..dd5fdd9 --- /dev/null +++ b/docs/reference/fslbet_robust.html @@ -0,0 +1,286 @@ + + + + + + + + +Robust Skull Stripping with COG estimation and Bias Correction — fslbet_robust • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Skull Stripping (using FSL's BET) a file using fslr +functions and robustified by registration and neck removal

    +
    + +
    fslbet_robust(
    +  img,
    +  outfile = NULL,
    +  retimg = TRUE,
    +  correct = TRUE,
    +  correction = "N4",
    +  recog = TRUE,
    +  reorient = FALSE,
    +  bet.opts = "",
    +  nvoxels = 0,
    +  swapdim = TRUE,
    +  remove.neck = TRUE,
    +  remover = c("remove_neck", "double_remove_neck"),
    +  robust.mask = FALSE,
    +  rbm.voxels = 7,
    +  template.file = file.path(fsldir(), "data/standard", "MNI152_T1_1mm_brain.nii.gz"),
    +  template.mask = file.path(fsldir(), "data/standard",
    +    "MNI152_T1_1mm_brain_mask.nii.gz"),
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    (character) File to be skull stripped or object of class +nifti

    outfile

    (character) output filename

    retimg

    (logical) return image of class nifti

    correct

    Perform bias field correction

    correction

    (character) N3 or N4 correction?

    recog

    Rerun bet with a new center of gravity (COG) estimate

    reorient

    (logical) If retimg, should file be reoriented when read in? +Passed to readnii.

    bet.opts

    Options for fslbet

    nvoxels

    Number of voxels to dilate/erode. See fslfill2. +If nvoxels = 0, then no smoothing is done.

    swapdim

    Use fslswapdim to reorient image

    remove.neck

    Run remove_neck to register the template to a +thresholded image to remove neck slices.

    remover

    if remove.neck = TRUE, then which function +would you like to use to remove the neck

    robust.mask

    Run robust_brain_mask to register the template to a +thresholded image and inflate for

    rbm.voxels

    Number of voxels to inflate mask for robust_brain_mask

    template.file

    Template to warp to original image space, passed to +remove_neck

    template.mask

    Mask of template to use as rough brain mask, passed +to remove_neck

    verbose

    (logical) Should diagnostic output be printed?

    ...

    additional arguments passed to robust_brain_mask or +remove_neck.

    + +

    Value

    + +

    Skull-stripped nifti object

    +

    Note

    + +

    This function first thresholds an image, runs a rigid registration +(default in remove_neck) to drop any slices below the transformed +skull stripped template to remove neck slices. The neck-removed image is +then skull stripped using defaults in fslbet. A new +center of gravity is estiamted using cog, then the image is +skull stripped again using the new cog. After the skull stripped mask is +created, the image is dilated and eroded using fslfill2 to +fill holes using a box kernel with the number of voxels nvoxels in +all 3 directions.

    + +

    Examples

    +
    
    +  
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/group_xyz2.html b/docs/reference/group_xyz2.html new file mode 100644 index 0000000..68b9248 --- /dev/null +++ b/docs/reference/group_xyz2.html @@ -0,0 +1,179 @@ + + + + + + + + +Center of Gravity for Multiple Components/Areas — group_xyz2 • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Find center of gravity for each compoent of an image

    +
    + +
    group_xyz2(img, k = 1)
    + +

    Arguments

    + + + + + + + + + + +
    img

    Object of class nifti or array

    k

    Minimum number of voxels for a cluster/component. +See ants_bwlabel

    + +

    Value

    + +

    Matrix of 3 columns of dimension indices.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/image_similarity.html b/docs/reference/image_similarity.html new file mode 100644 index 0000000..8c9f0ca --- /dev/null +++ b/docs/reference/image_similarity.html @@ -0,0 +1,208 @@ + + + + + + + + +Compute Image Similarity Metrics — image_similarity • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Compute Image Similarity Metrics

    +
    + +
    image_similarity(image1, image2, image1_mask = NULL, image2_mask = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    image1

    Object of class nifti or character filename. +Passed to the fixed image in imageSimilarity

    image2

    Object of class nifti or character filename +Passed to the moving image in imageSimilarity

    image1_mask

    Mask for first image (optional)

    image2_mask

    Mask for second image (optional)

    ...

    Additional arguments to pass to +imageSimilarity

    + +

    Value

    + +

    A numeric value

    +

    Note

    + +

    Not all metrics are symmetric.

    + +

    Examples

    +
    library(ANTsRCore) +library(extrantsr) +x = getANTsRData( 'r16' ) +y = getANTsRData( 'r30' ) +image_similarity(x,y, type="MeanSquares")
    #> [1] 1300.522
    image_similarity(y,x, type="MeanSquares")
    #> [1] 1300.522
    +image_similarity(x,y, type="Correlation")
    #> [1] -0.8218697
    image_similarity(y,x, type="Correlation")
    #> [1] -0.8218697
    +# NOT SYMMETRIC +image_similarity(x,y, type="MattesMutualInformation")
    #> [1] -0.5060095
    image_similarity(y,x, type="MattesMutualInformation")
    #> [1] -0.5059599
    +# NOT SYMMETRIC +mutual_information(x, y)
    #> [1] -0.5278006
    #> [1] -0.5261494
    +image_similarity(x,y, type="ANTSNeighborhoodCorrelation")
    #> [1] -0.7409918
    image_similarity(y,x, type="ANTSNeighborhoodCorrelation")
    #> [1] -0.7409918
    image_similarity(x,y, type="JointHistogramMutualInformation")
    #> [1] -0.7837214
    image_similarity(y,x, type="JointHistogramMutualInformation")
    #> [1] -0.7837214
    image_similarity(x,y, type="Demons")
    #> [1] 1300.522
    image_similarity(y,x, type="Demons")
    #> [1] 1300.522
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/img_cov_matrix.html b/docs/reference/img_cov_matrix.html new file mode 100644 index 0000000..4cbc083 --- /dev/null +++ b/docs/reference/img_cov_matrix.html @@ -0,0 +1,219 @@ + + + + + + + + +Neighborhood Covariance Matrix — img_cov_matrix • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Calculates the neighborhood of multiple images, and then +does the covariance of each neighbor with itself in the other imaging modality

    +
    + +
    img_cov_matrix(
    +  imgs,
    +  mask = NULL,
    +  radius = rep(1, 3),
    +  method = c("pearson", "spearman"),
    +  center = TRUE,
    +  scale = FALSE,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    imgs

    list of images of class nifti, antsImage, character

    mask

    Binary image of class nifti, +antsImage, character. Only neighborhoods inside the mask +will be taken

    radius

    vector of length 3 for number of voxels to go in each direction. +Default is 27 neighbors (including voxel at center). +Passed to getNeighborhoodInMask.

    method

    Type of correlation. If pearson, scaling done on original data. +If spearman, the ranks. If you want a covariance, you simply need to do +scale = FALSE

    center

    Should the data be centered

    scale

    Should the data be scaled

    verbose

    print diagnostic messages

    + +

    Value

    + +

    List of matrix of covariances for each voxel and the order the columns +are in.

    +

    #' @export

    +

    Note

    + +

    Divisor is n - 1.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/img_density_entropy.html b/docs/reference/img_density_entropy.html new file mode 100644 index 0000000..37b59f5 --- /dev/null +++ b/docs/reference/img_density_entropy.html @@ -0,0 +1,194 @@ + + + + + + + + +Image Entropy using density — img_density_entropy • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get the entropy for an entire image using density binning

    +
    + +
    img_density_entropy(img, mask = NULL, base = exp(1), ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    img

    object of class nifti or character

    mask

    binary object of class nifti or character

    base

    Base to take the log for the entropy. Default is e

    ...

    Additional arguments to pass to density.

    + + +

    Examples

    +
    library(oro.nifti)
    #> oro.nifti 0.10.2
    #> ------------------------------------------------------------------------------
    #> You have loaded oro.nifti after extrantsr (either directly or from another package) - this is likely to cause problems with certain functions on antsImage types, such as origin. +#> If you need functions from both extrantsr and oro.nifti, please load oro.nifti first, then extrantsr: +#> library(oro.nifti); library(extrantsr)
    #> ------------------------------------------------------------------------------
    #> +#> Attaching package: ‘oro.nifti’
    #> The following objects are masked from ‘package:ANTsRCore’: +#> +#> origin, origin<-
    #> The following objects are masked from ‘package:extrantsr’: +#> +#> origin, origin<-
    arr = array(rnorm(100^3), dim = rep(100, 3)) +img = oro.nifti::nifti(arr) +img_density_entropy(img)
    #> [1] 5.321614
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/img_hist_entropy.html b/docs/reference/img_hist_entropy.html new file mode 100644 index 0000000..c7fd7d7 --- /dev/null +++ b/docs/reference/img_hist_entropy.html @@ -0,0 +1,193 @@ + + + + + + + + +Image Entropy using histograms — img_hist_entropy • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get the entropy for an entire image using histogram binning

    +
    + +
    img_hist_entropy(img, mask = NULL, breaks = 2000, base = exp(1), ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    object of class nifti or character

    mask

    binary object of class nifti or character

    breaks

    Number of breaks to pass to hist

    base

    Base to take the log for the entropy. Default is e

    ...

    Additional arguments to pass to hist. Plot has already been +set to FALSE

    + + +

    Examples

    +
    library(oro.nifti) +arr = array(rnorm(100^3), dim = rep(100, 3)) +img = oro.nifti::nifti(arr) +img_hist_entropy(img)
    #> [1] 6.71553
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/img_split.html b/docs/reference/img_split.html new file mode 100644 index 0000000..ff54f52 --- /dev/null +++ b/docs/reference/img_split.html @@ -0,0 +1,182 @@ + + + + + + + + +Split an Image into Multiple Sub-Images — img_split • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Split an image on a certain dimension

    +
    + +
    img_split(img, output_basename = NULL, verbose = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    Object of class antsImage

    output_basename

    prefix for output files

    verbose

    print diagnostic messages

    + +

    Value

    + +

    Names of output files

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..36e042a --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,723 @@ + + + + + + + + +Function reference • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    origin() `origin<-`()

    +

    Extract Image Attributes origin from antsImage or nifti +objects

    +

    ants.extract()

    +

    Extract values from antsImage from mask

    +

    ants.overlay()

    +

    Plot Lightbox for antsImage

    +

    ants2oro()

    +

    Convert Between antsImage and nifti objects

    +

    antsCopyOrigin() antsCopyDirection() antsCopySpacing()

    +

    Copy Information of One Image to Another

    +

    ants_apply_transforms()

    +

    Apply ANTs transforms to nifti images

    +

    ants_bwlabel()

    +

    ANTs BWLabel Clusters of Certain Size

    +

    ants_regwrite()

    +

    Registration to a Template

    +

    applyEmptyImageDimensions(<antsImage>)

    +

    Apply Subsetting from Empty Image Dimensions

    +

    apply_malf_regs()

    +

    Apply MALF Registrations

    +

    apply_multi_reg()

    +

    Check if antsImage or read in

    +

    bias_correct() bias_correct_ants()

    +

    N3 or N4 Correct

    +

    bias_ss()

    +

    Bias Field Correct then Skull Strip

    +

    brain_extract()

    +

    Wrapper for ANTs brain extraction

    +

    c3d()

    +

    Convert NeuroImage Types

    +

    check_ants(<nifti>)

    +

    Check if antsImage or read in

    +

    check_nifti(<antsImage>)

    +

    Check if nifti image or read in a nifti image

    +

    checkimg(<antsImage>)

    +

    Force object to filename

    +

    compose_transform_to_file()

    +

    Compose Transforms from ANTsR to a composite file

    +

    corr_img()

    +

    Neighborhood Correlation Image

    +

    cort_thickness() kk()

    +

    Compute cortical thickness using Kelly Kapowski (ANTsR)

    +

    create_moment()

    +

    Create Neighborhood Momemts of an Image

    +

    diff_self()

    +

    Flipped Difference Image

    +

    double_remove_neck()

    +

    Remove Neck Twice from a Scan

    +

    emptyImageDimensionsMask(<antsImage>)

    +

    Make Mask from Empty Image Dimensions

    +

    face_removal_mask_ants() deface_image_ants()

    +

    Face Removal Mask using ANTs Registration

    +

    fill_2d_z()

    +

    Image Mask Filler over each slice in Z-direction

    +

    filler()

    +

    Image Mask Filler

    +

    finite_img(<antsImage>)

    +

    Finite Image

    +

    fslbet_robust()

    +

    Robust Skull Stripping with COG estimation and Bias Correction

    +

    group_xyz2()

    +

    Center of Gravity for Multiple Components/Areas

    +

    image_similarity()

    +

    Compute Image Similarity Metrics

    +

    img_cov_matrix()

    +

    Neighborhood Covariance Matrix

    +

    img_density_entropy()

    +

    Image Entropy using density

    +

    img_hist_entropy()

    +

    Image Entropy using histograms

    +

    img_split()

    +

    Split an Image into Multiple Sub-Images

    +

    inpaint()

    +

    Inpainting of images

    +

    jacobian_image() log_jacobian_image() geom_jacobian_image() log_geom_jacobian_image()

    +

    Image of the Determinant of the Jacobian

    +

    label_clusters()

    +

    Label Clusters

    +

    label_mask()

    +

    Label Connected Components

    +

    largest_component()

    +

    Get Largest Component

    +

    local_quantile_img()

    +

    Quantile Transform Voxel based on Neighborhood Distribution

    +

    makepng()

    +

    Non-exported function to make png

    +

    malf()

    +

    Multi-Atlas Label Fusion

    +

    malf_registration()

    +

    Multi-Atlas Label Fusion Registration

    +

    maskEmptyImageDimensions(<antsImage>)

    +

    Apply Masking from Empty Image Dimensions

    +

    multi_reg()

    +

    Multi-Registration

    +

    multi_rereg()

    +

    Two-Stage Multi-Registration of images

    +

    mutual_information()

    +

    Calculates Mutual Information on nifti objects

    +

    my.tab()

    +

    Quick Tabulation for logical vectors

    +

    n4_4d()

    +

    Four-Dimensional Bias-Field Correction

    +

    neighborhood()

    +

    Get Neighborhood of Voxels from an Image

    +

    neighborhood_index()

    +

    Get Neighborhood Matrix of Indices from an Image

    +

    oMask() get_mask()

    +

    Get Mask from nifti object

    +

    oMath()

    +

    Perform iMath on nifti objects

    +

    oasis()

    +

    OASIS Processing Pipeline

    +

    oro2ants()

    +

    Convert Between nifti and antsImage

    +

    ortho2(<antsImage>) ortho2(<niftiImage>)

    +

    Orthographic Display, added options

    +

    otropos()

    +

    Run Atropos for nifti objects

    +

    otropos2()

    +

    Run Atropos for nifti objects

    +

    perona_malik()

    +

    Perona-Malik Anisotropic Filter

    +

    pixdim(<antsImage>)

    +

    Extract Image pixdim attribute

    +

    preprocess_mri_across()

    +

    Preprocess MRI acros visits

    +

    preprocess_mri_within()

    +

    Within Visit Registration

    +

    process_filenames()

    +

    Process filenames to ensure nifti and consistency

    +

    read_transformlist()

    +

    Read Transform List from ANTsR

    +

    reapply_malf()

    +

    Reapply MALF Operation

    +

    reg_flip()

    +

    Flip Image with Registration

    +

    reg_flip_img()

    +

    Flip Image with Registration

    +

    reg_whitestripe()

    +

    WhiteStripe Normalization

    +

    reg_zscore()

    +

    Z-score Normalization

    +

    registration()

    +

    Registration Wrapper function

    +

    remove_neck()

    +

    Remove Neck from Image

    +

    reorder_neigh_indices()

    +

    Reorder Voxel Neighborhood

    +

    reproducible_ants()

    +

    Set reproducible seeds and threads for ANTsR execution

    +

    resample_image() .resample_image()

    +

    Resample an image

    +

    resample_to_target() .resample_to_target()

    +

    Resample an Image to a Target Image

    +

    robust_brain_mask()

    +

    Robust Brain Mask from Template

    +

    scaled_neighborhood()

    +

    Get Scaled Neighborhood of Voxels from an Image

    +

    sim()

    +

    Calculate Overlap Metrics

    +

    smooth_image()

    +

    Gaussian smooth image using ANTsR

    +

    smri_preproc()

    +

    Standard MRI Preprocessing

    +

    ss_bias()

    +

    Skull Strip then Bias Field Correct

    +

    stat_img()

    +

    Create Statistics Image

    +

    subset_4d() .subset_4d()

    +

    Subset a 4D image

    +

    tempants()

    +

    Create temporary nii.gz file from antsImage

    +

    transformlist_from_outprefix()

    +

    Get list of transforms that would likely be made with a specific `outprefix`

    +

    within_visit_registration()

    +

    Within Visit Registration

    +

    write_transformlist()

    +

    Read Transform List from ANTsR

    +

    zero_pad()

    +

    Zero pads an image

    +

    zscore_template()

    +

    Create Z-score-to-Template Image

    +
    + + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/inpaint.html b/docs/reference/inpaint.html new file mode 100644 index 0000000..ce21119 --- /dev/null +++ b/docs/reference/inpaint.html @@ -0,0 +1,193 @@ + + + + + + + + +Inpainting of images — inpaint • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Paints in the image with the mean/median from +fill_mask

    +
    + +
    inpaint(img, input_mask, fill_mask, func = c("mean", "median"), ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    image of class nifti or character

    input_mask

    mask to be painted in.

    fill_mask

    image mask to take the function (e.g. mean/median) of the image

    func

    Function to apply on the values. do.call will be called on them

    ...

    Arguments to be passed to func.

    + +

    Value

    + +

    List of output image (outimg) and +statistic filled in (statistic)

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/jacobian_image.html b/docs/reference/jacobian_image.html new file mode 100644 index 0000000..3b96957 --- /dev/null +++ b/docs/reference/jacobian_image.html @@ -0,0 +1,237 @@ + + + + + + + + +Image of the Determinant of the Jacobian — jacobian_image • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Image of the Determinant of the Jacobian

    +
    + +
    jacobian_image(
    +  fixed,
    +  transformlist = NULL,
    +  moving = NULL,
    +  typeofTransform = "SyN",
    +  ...
    +)
    +
    +log_jacobian_image(
    +  fixed,
    +  transformlist = NULL,
    +  moving = NULL,
    +  typeofTransform = "SyN",
    +  ...
    +)
    +
    +geom_jacobian_image(
    +  fixed,
    +  transformlist = NULL,
    +  moving = NULL,
    +  typeofTransform = "SyN",
    +  ...
    +)
    +
    +log_geom_jacobian_image(
    +  fixed,
    +  transformlist = NULL,
    +  moving = NULL,
    +  typeofTransform = "SyN",
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    fixed

    Fixed image in a registration

    transformlist

    List of transformation of moving image to +fixed image. Only one of transformlist or moving +should be specified.

    moving

    Image to transform into fixed space, if not +done previously. Only one of transformlist or moving +should be specified.

    typeofTransform

    If registration not done previously, +then transform to use for transformation. Should be non-linear.

    ...

    additional arguments to pass to registration

    + +

    Value

    + +

    An image of the determinant of the Jacobian, the +transform list, and the fixed image.

    + +

    Examples

    +
    library(extrantsr) +library(ANTsR) +library(methods) +fi<-antsImageRead( getANTsRData("r16") ,2) +mi<-antsImageRead( getANTsRData("r64") ,2) +fi<-resampleImage(fi,c(128,128),1,0) +mi<-resampleImage(mi,c(128,128),1,0) +mytx<-antsRegistration(fixed=fi , moving=mi, typeofTransform = c("SyN") ) +jac<-createJacobianDeterminantImage(fi,mytx$fwdtransforms[[1]],1) +jac = jacobian_image(fixed = fi, moving = mi, verbose = FALSE)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/label_clusters.html b/docs/reference/label_clusters.html new file mode 100644 index 0000000..5f1bd7e --- /dev/null +++ b/docs/reference/label_clusters.html @@ -0,0 +1,184 @@ + + + + + + + + +Label Clusters — label_clusters • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Label Clusters

    +
    + +
    label_clusters(img, ..., retfile = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    input image

    ...

    additional arguments passed to labelClusters

    retfile

    logical to indicate if an antsImage should be returned +TRUE (useful for chaining) or a nifti image

    + +

    Value

    + +

    A antsImage or a nifti image, depending on +retfile

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/label_mask.html b/docs/reference/label_mask.html new file mode 100644 index 0000000..f8cdfdc --- /dev/null +++ b/docs/reference/label_mask.html @@ -0,0 +1,178 @@ + + + + + + + + +Label Connected Components — label_mask • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Label a binary image with connected components

    +
    + +
    label_mask(img, k = 1)
    + +

    Arguments

    + + + + + + + + + + +
    img

    Object of class nifti or array

    k

    Minimum number of voxels for a cluster/component.

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/largest_component.html b/docs/reference/largest_component.html new file mode 100644 index 0000000..481eed7 --- /dev/null +++ b/docs/reference/largest_component.html @@ -0,0 +1,183 @@ + + + + + + + + +Get Largest Component — largest_component • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + + +
    largest_component(img, ..., retfile = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    Object of class nifti

    ...

    Additional arguments passed to iMath

    retfile

    logical to indicate if an antsImage should be returned +(useful for chaining)

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/local_quantile_img.html b/docs/reference/local_quantile_img.html new file mode 100644 index 0000000..3b6a720 --- /dev/null +++ b/docs/reference/local_quantile_img.html @@ -0,0 +1,195 @@ + + + + + + + + +Quantile Transform Voxel based on Neighborhood Distribution — local_quantile_img • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Quantile Transform Voxel based on Neighborhood Distribution

    +
    + +
    local_quantile_img(img, mask = NULL, radius = rep(1, 3), verbose = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti, character or antsImage

    mask

    Binary image of class nifti, +antsImage, character. Only neighborhoods inside the mask +will be taken

    radius

    vector of length 3 for number of voxels to go in each direction. +Default is 27 neighbors (including voxel at center). +Passed to getNeighborhoodInMask.

    verbose

    Print diagnostic messages

    + +

    Value

    + +

    An object of class nifti

    + +

    Examples

    +
    nim = oro.nifti::nifti(array(rnorm(10^3), dim = rep(10, 3))) +mask = nim > -1 +res = local_quantile_img(nim, mask = mask)
    #> Getting Image and Mask
    #> Creating argument list
    #> Running getNeighborhood
    #> Reordering output
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/makepng.html b/docs/reference/makepng.html new file mode 100644 index 0000000..8ca33b3 --- /dev/null +++ b/docs/reference/makepng.html @@ -0,0 +1,182 @@ + + + + + + + + +Non-exported function to make png — makepng • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Make my png

    +
    + +
    makepng(outfile, addstub, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    outfile

    Filename to be added to for png

    addstub

    extension to add to outfile

    ...

    arguments passed to png

    + +

    Value

    + +

    Alpha level depending on device

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/malf.html b/docs/reference/malf.html new file mode 100644 index 0000000..1d62e27 --- /dev/null +++ b/docs/reference/malf.html @@ -0,0 +1,265 @@ + + + + + + + + +Multi-Atlas Label Fusion — malf • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes in an input file and template images with +a set of template structures and creates a label fusion

    +
    + +
    malf(
    +  infile,
    +  template.images,
    +  template.structs,
    +  inverted = FALSE,
    +  keep_images = FALSE,
    +  outfiles = NULL,
    +  outfile = NULL,
    +  retimg = TRUE,
    +  func = "mode",
    +  ties.method = "first",
    +  keep_regs = FALSE,
    +  outprefix = NULL,
    +  interpolator = "NearestNeighbor",
    +  typeofTransform = "SyN",
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    infile

    Input Image file

    template.images

    Template Images to register +to infile

    template.structs

    Template gold standards to apply +registration into infile space

    inverted

    Should the MALF be inverted +(infile to template then use inverse transforms)

    keep_images

    Keep the template.structs in +infile space

    outfiles

    Output filenames for template.structs in +infile space

    outfile

    Fused output filename

    retimg

    Return Image to user using readnii

    func

    function to combine labels. See stat_img.

    ties.method

    If func = "mode", then this is passed to +stat_img.

    keep_regs

    Keep list of registrations. If TRUE, then +remove.warp = FALSE in registration

    outprefix

    passed to registration if +keep_regs = TRUE

    interpolator

    interpolation done for +antsApplyTransforms

    typeofTransform

    type of transformed used, passed to +antsRegistration

    verbose

    Print diagnostic output

    ...

    Arguments to be passed to malf_registration, which +really are options for registration

    + +

    Value

    + +

    The output filename or the nifti image or list of registrations and +output file

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/malf_registration.html b/docs/reference/malf_registration.html new file mode 100644 index 0000000..201b1e3 --- /dev/null +++ b/docs/reference/malf_registration.html @@ -0,0 +1,250 @@ + + + + + + + + +Multi-Atlas Label Fusion Registration — malf_registration • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes in an input file and template images with +a set of template structures and registers them

    +
    + +
    malf_registration(
    +  infile,
    +  template.images,
    +  template.structs,
    +  inverted = FALSE,
    +  typeofTransform = "SyN",
    +  interpolator = "NearestNeighbor",
    +  keep_images = TRUE,
    +  outfiles = NULL,
    +  outprefix = NULL,
    +  verbose = TRUE,
    +  rerun_registration = TRUE,
    +  image_interpolator = "Linear",
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    infile

    Input Image file

    template.images

    Template Images to register +to infile

    template.structs

    Template gold standards to apply +registration into infile space

    inverted

    Should the MALF be inverted +(infile to template then use inverse transforms)

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    interpolation done for +antsApplyTransforms for the structures

    keep_images

    Keep the template.structs in +infile space

    outfiles

    Output filenames for template.structs in +infile space

    outprefix

    passed to registration if +keep_regs = TRUE

    verbose

    Print diagnostic output

    rerun_registration

    Should malf be run again +if transforms already exist?

    image_interpolator

    interpolation done for +antsApplyTransforms for the images, +rarely used

    ...

    Arguments to be passed to registration

    + +

    Value

    + +

    List of registrations and +output files

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/maskEmptyImageDimensions-methods.html b/docs/reference/maskEmptyImageDimensions-methods.html new file mode 100644 index 0000000..01e1dfa --- /dev/null +++ b/docs/reference/maskEmptyImageDimensions-methods.html @@ -0,0 +1,201 @@ + + + + + + + + +Apply Masking from Empty Image Dimensions — maskEmptyImageDimensions,antsImage-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Simple wrapper for replacing indices with a value

    +
    + +
    # S4 method for antsImage
    +maskEmptyImageDimensions(img, inds, reorient = FALSE, mask.value = 0, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    image, nifti object, or array

    inds

    indices of subset from getEmptyImageDimensions or +dropEmptyImageDimensions.

    reorient

    Should image be reoriented if a filename?

    mask.value

    Value to replace voxels outside the mask.

    ...

    not used

    + +

    Value

    + +

    Object of class nifti or array if nifti +is not supplied

    +

    Note

    + +

    apply_empty_dim is a shorthand for +maskEmptyImageDimensions with all the same arguments.

    +

    See also

    + +

    getEmptyImageDimensions, +dropEmptyImageDimensions

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/multi_reg.html b/docs/reference/multi_reg.html new file mode 100644 index 0000000..5c77310 --- /dev/null +++ b/docs/reference/multi_reg.html @@ -0,0 +1,223 @@ + + + + + + + + +Multi-Registration — multi_reg • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes a list of images and registers them to a template, +keeping the registration information in a list.

    +
    + +
    multi_reg(
    +  infiles,
    +  template.file,
    +  outfiles = NULL,
    +  typeofTransform = "SyN",
    +  interpolator = "Linear",
    +  outprefix = NULL,
    +  retimg = TRUE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    infiles

    Input image files

    template.file

    Template image to register +to

    outfiles

    Output filenames for template.structs in +infile space

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    interpolation done for +antsApplyTransforms

    outprefix

    Character path of where the warp files and transformations +should be stored.

    retimg

    Return image to user using readnii

    verbose

    Print diagnostic output

    ...

    Arguments to be passed to ants_regwrite

    + +

    Value

    + +

    Output list of registered images and transformations

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/multi_rereg.html b/docs/reference/multi_rereg.html new file mode 100644 index 0000000..5f274e8 --- /dev/null +++ b/docs/reference/multi_rereg.html @@ -0,0 +1,197 @@ + + + + + + + + +Two-Stage Multi-Registration of images — multi_rereg • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes a list of images and registers them to a template, +takes a statistic image, and registers the list of images back to this +statistic image.

    +
    + +
    multi_rereg(infiles, template.file, func = "mean", ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    infiles

    Input image files

    template.file

    Template image to register to for first pass. +Second pass will be statistic image

    func

    Function to be passed to

    ...

    Arguments to be passed to multi_reg.

    + +

    Value

    + +

    Output list of statistic image, +registered images to statistic image +and transformations

    +

    Note

    + +

    The second stage will use the same arguments passed in ..., but +the template.file will be the statistic image

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/mutual_information.html b/docs/reference/mutual_information.html new file mode 100644 index 0000000..5c30f8b --- /dev/null +++ b/docs/reference/mutual_information.html @@ -0,0 +1,193 @@ + + + + + + + + +Calculates Mutual Information on nifti objects — mutual_information • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Images are converted nifti objects +(from the oro.nifti package), an operation is performed using +antsImageMutualInformation

    +
    + +
    mutual_information(image1, image2, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    image1

    Object of class nifti or character filename

    image2

    Object of class nifti or character filename

    ...

    Additional arguments passed to +antsImageMutualInformation

    + +

    Value

    + +

    Numeric

    + +

    Examples

    +
    library(ANTsR) +library(extrantsr) +fi = getANTsRData("r16") +mi = getANTsRData("r64") +mival = mutual_information(fi, mi)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/my.tab.html b/docs/reference/my.tab.html new file mode 100644 index 0000000..626a608 --- /dev/null +++ b/docs/reference/my.tab.html @@ -0,0 +1,182 @@ + + + + + + + + +Quick Tabulation for logical vectors — my.tab • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Speeds up on table for logical x and y

    +
    + +
    my.tab(x, y, dnames = c("x", "y"))
    + +

    Arguments

    + + + + + + + + + + + + + + +
    x

    Logical or 0/1 vector

    y

    Logical or 0/1 vector

    dnames

    names for table

    + +

    Value

    + +

    table of x vs y

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/n4_4d.html b/docs/reference/n4_4d.html new file mode 100644 index 0000000..a7ab073 --- /dev/null +++ b/docs/reference/n4_4d.html @@ -0,0 +1,186 @@ + + + + + + + + +Four-Dimensional Bias-Field Correction — n4_4d • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Four-Dimensional Bias-Field Correction

    +
    + +
    n4_4d(img, verbose = TRUE, correction = "N4", ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    img

    Image for N4 to be run, an antsImage

    verbose

    Print diagnostic messages

    correction

    Correction to do (N4 or N3)

    ...

    arguments to pass to bias_correct_ants

    + +

    Value

    + +

    An object of class antsImage

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/neighborhood.html b/docs/reference/neighborhood.html new file mode 100644 index 0000000..467aa75 --- /dev/null +++ b/docs/reference/neighborhood.html @@ -0,0 +1,215 @@ + + + + + + + + +Get Neighborhood of Voxels from an Image — neighborhood • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps the getNeighborhoodInMask to +be more friendly for R and nifti objects

    +
    + +
    neighborhood(
    +  img,
    +  mask = NULL,
    +  radius = rep(1, 3),
    +  get.gradient = TRUE,
    +  verbose = TRUE,
    +  run_gc = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti, character or antsImage

    mask

    Binary image of class nifti, +antsImage, character. Only neighborhoods inside the mask +will be taken

    radius

    vector of length 3 for number of voxels to go in each direction. +Default is 27 neighbors (including voxel at center). +Passed to getNeighborhoodInMask.

    get.gradient

    logical indicating if a matrix of gradients (at the center voxel) +should be returned in addition to the value matrix

    verbose

    Print diagnostic messages

    run_gc

    Experimental - trying to run with gc(); for memory cleanup.

    ...

    arguments other than spatial.info passed to +getNeighborhoodInMask

    + +

    Value

    + +

    List similar to the output of +getNeighborhoodInMask

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/neighborhood_index.html b/docs/reference/neighborhood_index.html new file mode 100644 index 0000000..36b9654 --- /dev/null +++ b/docs/reference/neighborhood_index.html @@ -0,0 +1,181 @@ + + + + + + + + +Get Neighborhood Matrix of Indices from an Image — neighborhood_index • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps the neighborhood to +get the matrix of data in the format of array indices (not values of data)

    +
    + +
    neighborhood_index(img, ...)
    + +

    Arguments

    + + + + + + + + + + +
    img

    Object of class nifti, character or antsImage

    ...

    arguments other than get.gradient passed to +getNeighborhoodInMask

    + +

    Value

    + +

    List similar to the output of neighborhood

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/oMask.html b/docs/reference/oMask.html new file mode 100644 index 0000000..71ae3ab --- /dev/null +++ b/docs/reference/oMask.html @@ -0,0 +1,182 @@ + + + + + + + + +Get Mask from nifti object — oMask • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wraps getMask from ANTsR for +nifti objects

    +
    + +
    oMask(img, ...)
    +
    +get_mask(img, ...)
    + +

    Arguments

    + + + + + + + + + + +
    img

    Object of class nifti or character filename

    ...

    arguments to getMask

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/oMath.html b/docs/reference/oMath.html new file mode 100644 index 0000000..9d02967 --- /dev/null +++ b/docs/reference/oMath.html @@ -0,0 +1,187 @@ + + + + + + + + +Perform iMath on nifti objects — oMath • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Images are converted nifti objects +(from the oro.nifti package), an operation is performed using +iMath, and the result is a nifti object.

    +
    + +
    oMath(img, ..., retfile = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    Object of class nifti

    ...

    Additional arguments passed to iMath

    retfile

    logical to indicate if an antsImage should be returned +(useful for chaining)

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/oasis.html b/docs/reference/oasis.html new file mode 100644 index 0000000..56f4236 --- /dev/null +++ b/docs/reference/oasis.html @@ -0,0 +1,286 @@ + + + + + + + + +OASIS Processing Pipeline — oasis • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a T1 template +using ANTsR transformation

    +
    + +
    oasis(
    +  filename,
    +  skull_strip = TRUE,
    +  skull_stripfile = NULL,
    +  correct = TRUE,
    +  normalize = TRUE,
    +  normalize_file = NULL,
    +  retimg = TRUE,
    +  outfile = NULL,
    +  template.file = file.path(fsldir(), "data", "standard", "MNI152_T1_1mm_brain.nii.gz"),
    +  interpolator = "LanczosWindowedSinc",
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  typeofTransform = "Rigid",
    +  remove.warp = TRUE,
    +  outprefix = NULL,
    +  bet.opts = "-B -f 0.1 -v",
    +  betcmd = "bet",
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    filename

    filename of T1 image

    skull_strip

    do skull stripping with FSL BET

    skull_stripfile

    Output skull strip filename

    correct

    do N3 Bias correction

    normalize

    Normalize data using whitestripe

    normalize_file

    whitestripe image mask

    retimg

    return a nifti object from function

    outfile

    output filename should have .nii or .nii.gz +extension

    template.file

    Filename of template to warp to

    interpolator

    interpolation done for +antsApplyTransforms

    other.files

    Filenames of other iamges to be +transformed with the T1

    other.outfiles

    Output filenames of other.files to +be written

    typeofTransform

    type of transformed used, passed to +antsRegistration

    remove.warp

    (logical) Should warping images be deleted?

    outprefix

    Character path of where the warp files should be stored. +Required if remove.warp = FALSE

    bet.opts

    Options passed to fslbet

    betcmd

    BET command used, passed to fslbet

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to whitestripe

    + +

    Value

    + +

    NULL or object of class nifti for transformed T1 image

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/oro2ants.html b/docs/reference/oro2ants.html new file mode 100644 index 0000000..7975ef1 --- /dev/null +++ b/docs/reference/oro2ants.html @@ -0,0 +1,189 @@ + + + + + + + + +Convert Between nifti and antsImage — oro2ants • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    NIfTI data can be converted between nifti +(from the oro.nifti package) and antsImage objects.

    +
    + +
    oro2ants(img, reference = NULL, cleanup = TRUE, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti

    reference

    Object of class antsImage to +copy header information (origin, spacing, direction) (experimental)

    cleanup

    temporary files are deleted after they are read in

    ...

    arguments passed to checkimg

    + +

    Value

    + +

    Object of class antsImage

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ortho2-methods.html b/docs/reference/ortho2-methods.html new file mode 100644 index 0000000..02b6840 --- /dev/null +++ b/docs/reference/ortho2-methods.html @@ -0,0 +1,442 @@ + + + + + + + + +Orthographic Display, added options — ortho2,antsImage-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wrapper for of neurobase's ortho2 function +to work with antsImages

    +
    + +
    # S4 method for antsImage
    +ortho2(
    +  x,
    +  y = NULL,
    +  xyz = NULL,
    +  w = 1,
    +  col = gray(0:64/64),
    +  col.y = hotmetal(),
    +  zlim = NULL,
    +  zlim.y = NULL,
    +  NA.x = FALSE,
    +  NA.y = TRUE,
    +  crosshairs = TRUE,
    +  col.crosshairs = "red",
    +  xlab = "",
    +  ylab = "",
    +  axes = FALSE,
    +  oma = c(0, 0, 0, ifelse(ycolorbar, 5, 0)),
    +  mar = rep(0, 4),
    +  bg = "black",
    +  text = NULL,
    +  text.color = "white",
    +  text.cex = 2,
    +  text.x = 32,
    +  text.y = 32,
    +  add.orient = TRUE,
    +  mfrow = c(2, 2),
    +  ybreaks = NULL,
    +  breaks = NULL,
    +  addlegend = FALSE,
    +  leg.x = 32,
    +  leg.y = 32,
    +  legend,
    +  leg.col,
    +  leg.title = NULL,
    +  leg.cex,
    +  window = NULL,
    +  ycolorbar = FALSE,
    +  clabels = TRUE,
    +  add = TRUE,
    +  pdim = NULL,
    +  useRaster = TRUE,
    +  mask = NULL,
    +  ...
    +)
    +
    +# S4 method for niftiImage
    +ortho2(
    +  x,
    +  y = NULL,
    +  xyz = NULL,
    +  w = 1,
    +  col = gray(0:64/64),
    +  col.y = oro.nifti::hotmetal(),
    +  zlim = NULL,
    +  zlim.y = NULL,
    +  NA.x = FALSE,
    +  NA.y = TRUE,
    +  crosshairs = TRUE,
    +  col.crosshairs = "red",
    +  xlab = "",
    +  ylab = "",
    +  axes = FALSE,
    +  oma = c(0, 0, 0, ifelse(ycolorbar, 5, 0)),
    +  mar = rep(0, 4),
    +  bg = "black",
    +  text = NULL,
    +  text.color = "white",
    +  text.cex = 2,
    +  text.x = 32,
    +  text.y = 32,
    +  add.orient = FALSE,
    +  mfrow = c(2, 2),
    +  ybreaks = NULL,
    +  breaks = NULL,
    +  addlegend = FALSE,
    +  leg.x = 32,
    +  leg.y = 32,
    +  legend,
    +  leg.col,
    +  leg.title = NULL,
    +  leg.cex,
    +  window = NULL,
    +  ycolorbar = FALSE,
    +  clabels = TRUE,
    +  add = TRUE,
    +  pdim = NULL,
    +  useRaster = is.null(y),
    +  mask = NULL,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    x

    is an object of class antsImage or similar.

    y

    is an object of class antsImage or similar for the overlay.

    xyz

    is the coordinate for the center of the crosshairs.

    w

    is the time point to be displayed (4D arrays only).

    col

    is grayscale (by default).

    col.y

    is hotmetal (by default).

    zlim

    is the minimum and maximum `z' values passed into image.

    zlim.y

    is the minimum and maximum `z' values passed into image +for the overlay.

    NA.x

    Set any values of 0 in x to NA

    NA.y

    Set any values of 0 in y to NA

    crosshairs

    is a logical value for the presence of crosshairs +in all three orthogonal planes (default = TRUE).

    col.crosshairs

    is the color of the crosshairs (default = red).

    xlab

    is set to "" since all margins are set to zero.

    ylab

    is set to "" since all margins are set to zero.

    axes

    is set to FALSE since all margins are set to zero.

    oma

    is the size of the outer margins in the par function.

    mar

    is the number of lines of margin in the par function.

    bg

    is the background color in the par function.

    text

    allows the user to specify text to appear in +the fourth (unused) pane.

    text.color

    is the color of the user-specified text +(default = ``white").

    text.cex

    is the size of the user-specified text (default = 2).

    text.x

    x coordinate for text

    text.y

    y coordinate for text

    add.orient

    (logical) Add left/right, A/P, etc. orientation

    mfrow

    (numeric) layout of the 3 slices

    ybreaks

    (numeric) breaks for y to passed to +image

    breaks

    (numeric) breaks for x to passed to +image

    addlegend

    (logical) add legend?

    leg.x

    (numeric) x coord for legend

    leg.y

    (numeric) y coord for legend

    legend

    (character) legend text

    leg.col

    (character) Colors for legend

    leg.title

    (character) title for legend

    leg.cex

    (numeric) cex for legend

    window

    (vector) Length-2 vector to limit image to certain range

    ycolorbar

    (logical) Should a colorbar for y be plotted

    clabels

    Label for colorbar (see colorbar)

    add

    Should the y-plot be added or its own plot? Used +in double_ortho

    pdim

    Pixel dimensions if passing in arrays.

    useRaster

    logical; if TRUE a bitmap raster is used to +plot the image instead of polygons. Passed to +image.

    mask

    If a mask is passed, drop_empty_dim is applied +to both x and y

    ...

    other arguments to the image function may be provided here.

    + +

    Note

    + +

    This will NOT do ants2oro to plot the image. +If that is desired, users will have to do that before calling +ortho2.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/otropos.html b/docs/reference/otropos.html new file mode 100644 index 0000000..4aafe99 --- /dev/null +++ b/docs/reference/otropos.html @@ -0,0 +1,215 @@ + + + + + + + + +Run Atropos for nifti objects — otropos • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Runs Atropos (a finite mixture model) but with more +robust inputs

    +
    + +
    otropos(
    +  a,
    +  x,
    +  m = "[0.2,1x1x1]",
    +  verbose = TRUE,
    +  ...,
    +  make_mask = TRUE,
    +  reset_origin = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    a

    Images to segment. Can be a nifti object, +antsImage object, character vector, or list of these

    x

    Mask image. If none is supplied and make_mask = TRUE, +then mask is created by first

    m

    mrf parameters as a string, usually +"[smoothingFactor,radius]". Reset for 3D images, compared to +2D default atropos has.

    verbose

    print diagnostic messages

    ...

    Additional arguments to be passed to atropos

    make_mask

    Logical indicating if mask should be created if +x is missing. Mask is made using getMask with +first image of a.

    reset_origin

    Should antsCopyOrigin be done +on the mask?

    + +

    Value

    + +

    Result of atropos, but with nifti objects.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/otropos2.html b/docs/reference/otropos2.html new file mode 100644 index 0000000..55f7bed --- /dev/null +++ b/docs/reference/otropos2.html @@ -0,0 +1,195 @@ + + + + + + + + +Run Atropos for nifti objects — otropos2 • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Runs otropos but has different argument +names to be more consistent with extrantsr

    +
    + +
    otropos2(img, mask = NULL, smoothing_factor = 0.2, radius = c(1, 1, 1), ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    Images to segment.

    mask

    Mask of Image

    smoothing_factor

    amount of smoothing in Markov random Field. +Increasing this number causes more smoothing whereas decreasing +the number lessens the smoothing.

    radius

    the mrf neighborhood. Length must equal the number +of dimensions of img

    ...

    arguments to pass to otropos

    + +

    See also

    + +

    otropos, atropos

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/perona_malik.html b/docs/reference/perona_malik.html new file mode 100644 index 0000000..6fddc2d --- /dev/null +++ b/docs/reference/perona_malik.html @@ -0,0 +1,192 @@ + + + + + + + + +Perona-Malik Anisotropic Filter — perona_malik • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Wrapper for oMath("PeronaMalik")

    +
    + +
    perona_malik(img, n_iter, conductance, ..., retfile = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti

    n_iter

    number of iterations

    conductance

    From ITK: The conductance parameter controls the +sensitivity of the conductance term in the basic anisotropic diffusion equation

    ...

    Additional arguments passed to iMath

    retfile

    logical to indicate if an antsImage should be returned +(useful for chaining)

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/pixdim-methods.html b/docs/reference/pixdim-methods.html new file mode 100644 index 0000000..c51e04f --- /dev/null +++ b/docs/reference/pixdim-methods.html @@ -0,0 +1,180 @@ + + + + + + + + +Extract Image pixdim attribute — pixdim,antsImage-method • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Gets pixdim from an antsImage

    +
    + +
    # S4 method for antsImage
    +pixdim(object)
    + +

    Arguments

    + + + + + + +
    object

    is an antsImage

    + +

    Value

    + +

    Vector of numeric values

    + +

    Examples

    +
    library(ANTsRCore) +fn <- getANTsRData( "r16" ) +fi <- antsImageRead( fn ) +pixdim(fi)
    #> [1] 0 1 1 1 1 1 1 1
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/preprocess_mri_across.html b/docs/reference/preprocess_mri_across.html new file mode 100644 index 0000000..14cdc1d --- /dev/null +++ b/docs/reference/preprocess_mri_across.html @@ -0,0 +1,262 @@ + + + + + + + + +Preprocess MRI acros visits — preprocess_mri_across • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs preprocessing and registration +across visits and within visits

    +
    + +
    preprocess_mri_across(
    +  baseline_files,
    +  followup_files,
    +  baseline_outfiles,
    +  followup_outfiles,
    +  retimg = FALSE,
    +  maskfile = NULL,
    +  correct = TRUE,
    +  correction = "N4",
    +  skull_strip = TRUE,
    +  bet.opts = "-B -f 0.1 -v",
    +  betcmd = "bet",
    +  within.transform = "Rigid",
    +  within.interpolator = "LanczosWindowedSinc",
    +  across.transform = within.transform,
    +  across.interpolator = within.interpolator,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    baseline_files

    filename of baseline images

    followup_files

    filename of followup images

    baseline_outfiles

    output filenames for baseline images

    followup_outfiles

    output filenames for followup images

    retimg

    (logical) return list of images of class nifti

    maskfile

    Filename (or nifti object) of binary mask for baseline image. +If filename exists, skull stripping will be done by masking it. +If it does not, then skull stripping will get one from the baseline +image

    correct

    Perform bias field correction

    correction

    (character) N3 or N4 correction?

    skull_strip

    do Skull stripping with FSL BET

    bet.opts

    Options to pass to fslbet

    betcmd

    Command to pass to fslbet

    within.transform

    Transformation for within-visit registration

    within.interpolator

    Interpolator for within-visit registration

    across.transform

    Transformation for across-visit registration

    across.interpolator

    Interpolator for across-visit registration

    verbose

    print diagnostic outputs

    ...

    arguments to preprocess_mri_within and ants_regwrite

    + +

    Value

    + +

    list of objects from preprocess_mri_within and +registration

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/preprocess_mri_within.html b/docs/reference/preprocess_mri_within.html new file mode 100644 index 0000000..36ba9bf --- /dev/null +++ b/docs/reference/preprocess_mri_within.html @@ -0,0 +1,258 @@ + + + + + + + + +Within Visit Registration — preprocess_mri_within • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs skull stripping of the first image, +within-visit registration using a rigid-body transformation, +inhomogeneity correction, and potentially re-correcting after skull stripping.

    +
    + +
    preprocess_mri_within(
    +  files,
    +  outfiles = NULL,
    +  correct = TRUE,
    +  correction = "N4",
    +  retimg = FALSE,
    +  reorient = FALSE,
    +  typeofTransform = "Rigid",
    +  interpolator = "LanczosWindowedSinc",
    +  skull_strip = FALSE,
    +  bet.opts = "-B -f 0.1 -v",
    +  betcmd = "bet",
    +  maskfile = NULL,
    +  correct_after_mask = FALSE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    files

    filenames (or nifti objects) of images to be processed. +Will register to the first scan

    outfiles

    (character) name of output files, with extension

    correct

    do Bias field correction

    correction

    (character) N3 or N4 correction?

    retimg

    (logical) return list of images of class nifti

    reorient

    (logical) If retimg, should file be reoriented +when read in? +Passed to readnii.

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    Interpolation to be performed, passed to +antsRegistration

    skull_strip

    do Skull stripping with FSL BET

    bet.opts

    Options to pass to fslbet

    betcmd

    Command to pass to fslbet

    maskfile

    Filename (or nifti object) of mask for image to be +registered to

    correct_after_mask

    Should the inhomogeneity correction be run +after masking. If correct = FALSE, then

    verbose

    Diagnostic messages

    ...

    arguments to bias_correct or +within_visit_registration

    + +

    Value

    + +

    List of outfiles, maskfile, and output from registration.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/process_filenames.html b/docs/reference/process_filenames.html new file mode 100644 index 0000000..51d8aa1 --- /dev/null +++ b/docs/reference/process_filenames.html @@ -0,0 +1,189 @@ + + + + + + + + +Process filenames to ensure nifti and consistency — process_filenames • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes input and output filename, ensures the same +file extension, copies files, and checks all are character

    +
    + +
    process_filenames(files, outfiles, force_nii = TRUE, copyfiles = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    files

    input filenames

    outfiles

    output filenames

    force_nii

    Force output filenames to have .nii

    copyfiles

    copy files to outfiles

    + +

    Value

    + +

    List of 2 elements: files of the filenames and outfiles +of output filenames

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/read_transformlist.html b/docs/reference/read_transformlist.html new file mode 100644 index 0000000..49b8c17 --- /dev/null +++ b/docs/reference/read_transformlist.html @@ -0,0 +1,178 @@ + + + + + + + + +Read Transform List from ANTsR — read_transformlist • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Transform a transformlist from ANTsR into an object in R

    +
    + +
    read_transformlist(transformlist, useOro = TRUE)
    + +

    Arguments

    + + + + + + + + + + +
    transformlist

    Character vector of transform list

    useOro

    Use oro.nifti (if TRUE) or ANTs

    + +

    Value

    + +

    List of transforms

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reapply_malf.html b/docs/reference/reapply_malf.html new file mode 100644 index 0000000..60b736a --- /dev/null +++ b/docs/reference/reapply_malf.html @@ -0,0 +1,244 @@ + + + + + + + + +Reapply MALF Operation — reapply_malf • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes in an input file, set of registrations, +and a set of template structures and applies the registrations, +with a different interpolator if necessary, and then combines output

    +
    + +
    reapply_malf(
    +  infile,
    +  regs,
    +  template.structs,
    +  keep_images = FALSE,
    +  outfiles = NULL,
    +  outfile = NULL,
    +  retimg = TRUE,
    +  func = "mode",
    +  ties.method = "first",
    +  interpolator = NULL,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    infile

    Input Image file

    regs

    List of registrations from malf or +malf_registration, each element must have +fwdtransforms and interpolator. Same length as +template.structs

    template.structs

    Template gold standards to apply +registration into infile space

    keep_images

    Keep the template.structs in +infile space

    outfiles

    Output filenames for template.structs in +infile space

    outfile

    Fused output filename

    retimg

    Return Image to user using readnii

    func

    function to combine labels. See stat_img.

    ties.method

    If func = "mode", then this is passed to +stat_img.

    interpolator

    interpolation done for +antsApplyTransforms, can be different than original MALF

    verbose

    Print diagnostic output

    ...

    Arguments to be passed to ants_apply_transforms

    + +

    Value

    + +

    The output filename or the nifti image or list of registrations and +output file

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reg_flip.html b/docs/reference/reg_flip.html new file mode 100644 index 0000000..594b1ee --- /dev/null +++ b/docs/reference/reg_flip.html @@ -0,0 +1,277 @@ + + + + + + + + +Flip Image with Registration — reg_flip • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a template +using ANTsR and will run fslswapdim

    +
    + +
    reg_flip(
    +  t1,
    +  register = TRUE,
    +  native = TRUE,
    +  template.file = file.path(fsldir(), "data", "standard", paste0("MNI152_T1_1mm",
    +    ifelse(is.null(mask), "", "_brain"), ".nii.gz")),
    +  typeofTransform = c("Rigid", "Affine"),
    +  interpolator = "LanczosWindowedSinc",
    +  t1.outfile = NULL,
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  mask = NULL,
    +  mask.outfile = NULL,
    +  verbose = TRUE,
    +  a = "-x",
    +  b = "y",
    +  c = "z",
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    t1

    filename (or nifti objects) of T1 image

    register

    Register image to template file

    native

    If images are registered, should the native space +normalized image be returned?

    template.file

    Filename of template to warp to

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    Interpolation to be performed, passed to +antsRegistration

    t1.outfile

    Output filename of normalized T1 image

    other.files

    Character filenames or list of nifti objects to +normalize. In the same space as T1.

    other.outfiles

    Character filenames for output +normalized files.

    mask

    File or nifti image of brain mask

    mask.outfile

    Character filename for output +brain mask.

    verbose

    Print Diagnostic Messages

    a

    Option for x domain in fslswapdim

    b

    Option for y domain in fslswapdim

    c

    Option for z domain in fslswapdim

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to fslswapdim

    + +

    Value

    + +

    List of nifti objects or character filenames

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reg_flip_img.html b/docs/reference/reg_flip_img.html new file mode 100644 index 0000000..936ea1e --- /dev/null +++ b/docs/reference/reg_flip_img.html @@ -0,0 +1,277 @@ + + + + + + + + +Flip Image with Registration — reg_flip_img • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a template +using ANTsR and will run fslswapdim

    +
    + +
    reg_flip_img(
    +  t1,
    +  register = TRUE,
    +  native = TRUE,
    +  template.file = file.path(fsldir(), "data", "standard", paste0("MNI152_T1_1mm",
    +    ifelse(is.null(mask), "", "_brain"), ".nii.gz")),
    +  typeofTransform = c("Rigid", "Affine"),
    +  interpolator = "LanczosWindowedSinc",
    +  t1.outfile = NULL,
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  mask = NULL,
    +  mask.outfile = NULL,
    +  verbose = TRUE,
    +  flipx = FALSE,
    +  flipy = FALSE,
    +  flipz = FALSE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    t1

    filename (or nifti objects) of T1 image

    register

    Register image to template file

    native

    If images are registered, should the native space +normalized image be returned?

    template.file

    Filename of template to warp to

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    Interpolation to be performed, passed to +antsRegistration

    t1.outfile

    Output filename of normalized T1 image

    other.files

    Character filenames or list of nifti objects to +normalize. In the same space as T1.

    other.outfiles

    Character filenames for output +normalized files.

    mask

    File or nifti image of brain mask

    mask.outfile

    Character filename for output +brain mask.

    verbose

    Print Diagnostic Messages

    flipx

    Option for flipping x domain in flip_img

    flipy

    Option for flipping y domain in flip_img

    flipz

    Option for flipping z domain in flip_img

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to flip_img

    + +

    Value

    + +

    List of nifti objects or character filenames

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reg_whitestripe.html b/docs/reference/reg_whitestripe.html new file mode 100644 index 0000000..1d798eb --- /dev/null +++ b/docs/reference/reg_whitestripe.html @@ -0,0 +1,284 @@ + + + + + + + + +WhiteStripe Normalization — reg_whitestripe • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a T1 template +using ANTsR and SyN transformation

    +
    + +
    reg_whitestripe(
    +  t1 = NULL,
    +  t2 = NULL,
    +  register = TRUE,
    +  native = TRUE,
    +  template.file = file.path(fsldir(), "data", "standard", paste0("MNI152_T1_1mm",
    +    ifelse(is.null(mask), "", "_brain"), ".nii.gz")),
    +  typeofTransform = c("Rigid", "Affine"),
    +  interpolator = "LanczosWindowedSinc",
    +  type = c("T1", "T2", "hybrid"),
    +  t1.outfile = NULL,
    +  t2.outfile = NULL,
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  ws.outfile = NULL,
    +  mask = NULL,
    +  mask.outfile = NULL,
    +  verbose = TRUE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    t1

    filename (or nifti objects) of T1 image

    t2

    filename (or nifti objects) of T2 image

    register

    Register image to template file

    native

    If images are registered, should the native space +normalized image be returned?

    template.file

    Filename of template to warp to

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    Interpolation to be performed, passed to +antsRegistration

    type

    Type of whitestripe normalization done

    t1.outfile

    Output filename of normalized T1 image

    t2.outfile

    Output filename of normalized T2 image

    other.files

    Character filenames or list of nifti objects to +normalize. In the same space as T1.

    other.outfiles

    Character filenames for output +normalized files.

    ws.outfile

    Character filename for output +whitestripe mask.

    mask

    File or nifti image of brain mask

    mask.outfile

    Character filename for output +brain mask.

    verbose

    Print Diagnostic Messages

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to whitestripe or +whitestripe_hybrid

    + +

    Value

    + +

    List of nifti objects or character filenames

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reg_zscore.html b/docs/reference/reg_zscore.html new file mode 100644 index 0000000..396c193 --- /dev/null +++ b/docs/reference/reg_zscore.html @@ -0,0 +1,262 @@ + + + + + + + + +Z-score Normalization — reg_zscore • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a template +using ANTsR and will run zscore_img

    +
    + +
    reg_zscore(
    +  t1,
    +  register = TRUE,
    +  native = TRUE,
    +  template.file = file.path(fsldir(), "data", "standard", paste0("MNI152_T1_1mm",
    +    ifelse(is.null(mask), "", "_brain"), ".nii.gz")),
    +  typeofTransform = c("Rigid", "Affine"),
    +  interpolator = "LanczosWindowedSinc",
    +  t1.outfile = NULL,
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  mask = NULL,
    +  mask.outfile = NULL,
    +  verbose = TRUE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    t1

    filename (or nifti objects) of T1 image

    register

    Register image to template file

    native

    If images are registered, should the native space +normalized image be returned?

    template.file

    Filename of template to warp to

    typeofTransform

    type of transformed used, passed to +antsRegistration

    interpolator

    Interpolation to be performed, passed to +antsRegistration

    t1.outfile

    Output filename of normalized T1 image

    other.files

    Character filenames or list of nifti objects to +normalize. In the same space as T1.

    other.outfiles

    Character filenames for output +normalized files.

    mask

    File or nifti image of brain mask

    mask.outfile

    Character filename for output +brain mask.

    verbose

    Print Diagnostic Messages

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    ...

    arguments to zscore_img

    + +

    Value

    + +

    List of nifti objects or character filenames

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/registration.html b/docs/reference/registration.html new file mode 100644 index 0000000..a91e155 --- /dev/null +++ b/docs/reference/registration.html @@ -0,0 +1,327 @@ + + + + + + + + +Registration Wrapper function — registration • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration +using ANTsR, carries out the transformation +on other images, and can back-transform image +in registered space to the native space of the original image. Returns the +transforms

    +
    + +
    registration(
    +  filename,
    +  skull_strip = FALSE,
    +  correct = FALSE,
    +  correction = "N4",
    +  retimg = TRUE,
    +  outfile = NULL,
    +  template.file = file.path(fsldir(), "data", "standard", "MNI152_T1_1mm_brain.nii.gz"),
    +  interpolator = "Linear",
    +  other_interpolator = interpolator,
    +  other.files = NULL,
    +  other.outfiles = NULL,
    +  other.init = NULL,
    +  invert_interpolator = interpolator,
    +  invert.native.fname = NULL,
    +  invert.file = NULL,
    +  typeofTransform = "SyN",
    +  remove.warp = FALSE,
    +  outprefix = NULL,
    +  bet.opts = "-B -f 0.1 -v",
    +  betcmd = "bet",
    +  copy_origin = TRUE,
    +  verbose = TRUE,
    +  reproducible = TRUE,
    +  seed = 1,
    +  force_registration = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    filename

    filename of image to be registered

    skull_strip

    do skull stripping with FSL BET

    correct

    do bias correction on the filename

    correction

    N3 or N4 correction, see bias_correct

    retimg

    return a nifti object from function

    outfile

    output filename should have .nii or .nii.gz +extension

    template.file

    Filename of image to warp to

    interpolator

    interpolation done for +antsApplyTransforms

    other_interpolator

    interpolation done for +antsApplyTransforms for other.files

    other.files

    Filenames of other iamges to be +transformed with the T1

    other.outfiles

    Output filenames of other.files to +be written

    other.init

    Initial transformation lists (same length as other.files) +to use in before the estimated transformation for one interpolation

    invert_interpolator

    interpolation done for +antsApplyTransforms for invert.file

    invert.native.fname

    filename of output native file, must have +same length as invert.file or be NULL.

    invert.file

    Filename of image to invert to native space

    typeofTransform

    type of transformed used, passed to +antsRegistration

    remove.warp

    (logical) Should warping images be deleted?

    outprefix

    Character path of where the warp files should be stored. +Required if remove.warp = FALSE

    bet.opts

    Options passed to fslbet

    betcmd

    BET command used, passed to fslbet

    copy_origin

    Copy image origin from t1, using antsCopyOrigin

    verbose

    Print diagnostic messages

    reproducible

    Sets the seed and +Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 1). + See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result. If NULL, will not set anything, +but reproducible must be FALSE.

    force_registration

    If TRUE, then registration will +be run even if transforms exist.

    ...

    arguments to antsRegistration

    + +

    Value

    + +

    List of the output filenames and transformations

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/remove_neck.html b/docs/reference/remove_neck.html new file mode 100644 index 0000000..71b3db5 --- /dev/null +++ b/docs/reference/remove_neck.html @@ -0,0 +1,244 @@ + + + + + + + + +Remove Neck from Image — remove_neck • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Removes the neck from axially acquired scan so +skull stripping can be done.

    +
    + +
    remove_neck(
    +  file,
    +  template.file,
    +  template.mask = NULL,
    +  ret_mask = FALSE,
    +  typeofTransform = "Rigid",
    +  rep.value = 0,
    +  swapdim = TRUE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    File for neck removal - either filename or class nifti

    template.file

    Template to warp to original image space

    template.mask

    Mask of template to use as rough brain mask. If +template.file is specified, but template.mask is not, +then fslbin(file=template.file) is performed.

    ret_mask

    Return mask of slices to keep

    typeofTransform

    Transformation for template to image, passed to +ants_regwrite.

    rep.value

    Value to replace neck slices with

    swapdim

    Should the dimensions be swapped before registration, +and then reset after

    verbose

    Print out diagnostic messages

    ...

    Additional arguments passed to ants_regwrite

    + +

    Value

    + +

    Object of class nifti or vector of indices

    + +

    Examples

    +
    if (fslr::have.fsl()){ + print(fslr::fsl_version()) + in_ci <- function() { + nzchar(Sys.getenv("CI")) + } + if (in_ci()) { + destfile = tempfile(fileext = ".nii.gz") + dl = download.file(paste0( + "https://github.com/muschellij2/", + "Neurohacking/files/3454385/113-01-MPRAGE2.nii.gz"), + destfile = destfile) + tfile = fslr::mni_fname(brain = TRUE) + if (file.exists(tfile)) { + res = remove_neck( + destfile, + template.file = tfile, + template.mask = fslr::mni_fname(brain = TRUE, mask = TRUE) + ) + } + } +}
    #> [1] "5.0.10"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reorder_neigh_indices.html b/docs/reference/reorder_neigh_indices.html new file mode 100644 index 0000000..bcb5d0e --- /dev/null +++ b/docs/reference/reorder_neigh_indices.html @@ -0,0 +1,181 @@ + + + + + + + + +Reorder Voxel Neighborhood — reorder_neigh_indices • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    The output from getNeighborhoodInMask gets reordered +to match that which R uses for array to indices.

    +
    + +
    reorder_neigh_indices(indices, img.dim)
    + +

    Arguments

    + + + + + + + + + + +
    indices

    Indices from getNeighborhoodInMask

    img.dim

    Image dimension from which neighborhood was taken

    + +

    Value

    + +

    List of new indices, the ordering, and a binary array which has a +1 where the indices are located

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/reproducible_ants.html b/docs/reference/reproducible_ants.html new file mode 100644 index 0000000..f4c5bad --- /dev/null +++ b/docs/reference/reproducible_ants.html @@ -0,0 +1,188 @@ + + + + + + + + +Set reproducible seeds and threads for ANTsR execution — reproducible_ants • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Set reproducible seeds and threads for ANTsR execution

    +
    + +
    reproducible_ants(seed = 1)
    + +

    Arguments

    + + + + + + +
    seed

    will execute +Sys.setenv(ANTS_RANDOM_SEED = seed) before +running to attempt a more reproducible result.

    + +

    Value

    + +

    A list of `ANTS_RANDOM_SEED` and `ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS`

    +

    Note

    + +

    See +https://github.com/ANTsX/ANTs/wiki/antsRegistration-reproducibility-issues +for discussion.

    + +

    Examples

    +
    reproducible_ants(1234)
    #> $ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS +#> [1] 1 +#> +#> $ANTS_RANDOM_SEED +#> [1] 1234 +#>
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/resample_image-methods.html b/docs/reference/resample_image-methods.html new file mode 100644 index 0000000..9f6a6b3 --- /dev/null +++ b/docs/reference/resample_image-methods.html @@ -0,0 +1,258 @@ + + + + + + + + +Resample an image — resample_image-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Resamples an antsImage or +nifti +object

    +
    + +
    resample_image(
    +  img,
    +  parameters,
    +  parameter_type = c("mm", "voxels"),
    +  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
    +  ...
    +)
    +
    +# S4 method for character
    +resample_image(
    +  img,
    +  parameters,
    +  parameter_type = c("mm", "voxels"),
    +  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
    +  ...
    +)
    +
    +# S4 method for nifti
    +resample_image(
    +  img,
    +  parameters,
    +  parameter_type = c("mm", "voxels"),
    +  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
    +  ...
    +)
    +
    +# S4 method for antsImage
    +resample_image(
    +  img,
    +  parameters,
    +  parameter_type = c("mm", "voxels"),
    +  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline"),
    +  ...
    +)
    +
    +.resample_image(
    +  img,
    +  parameters,
    +  parameter_type = c("mm", "voxels"),
    +  interpolator = c("nearestneighbor", "linear", "gaussian", "windowedsinc", "bspline")
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    character path of image or +an object of class nifti, or antsImage

    parameters

    parameters +to pass as resampleParams in +resampleImage

    parameter_type

    Are the parameters in units of +voxels or millimeters (mm)

    interpolator

    what type of interpolation should be +done

    ...

    not currently used

    + +

    Value

    + +

    An antsImage or nifti depending on +input

    + +

    Examples

    +
    library(oro.nifti) +library(extrantsr) +n = 30 +x = nifti(array(rnorm(n^3*10), dim = c(n, n, n))) +res = resample_image(x, parameters = c(0.5, 0.5, 0.5)) +res
    #> NIfTI-1 format +#> Type : nifti +#> Data Type : 16 (FLOAT32) +#> Bits per Pixel : 32 +#> Slice Code : 0 (Unknown) +#> Intent Code : 0 (None) +#> Qform Code : 1 (Scanner_Anat) +#> Sform Code : 0 (Unknown) +#> Dimension : 60 x 60 x 60 +#> Pixel Dimension : 0.5 x 0.5 x 0.5 +#> Voxel Units : mm +#> Time Units : Unknown
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/resample_to_target-methods.html b/docs/reference/resample_to_target-methods.html new file mode 100644 index 0000000..42ef53e --- /dev/null +++ b/docs/reference/resample_to_target-methods.html @@ -0,0 +1,261 @@ + + + + + + + + +Resample an Image to a Target Image — resample_to_target-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Resamples an antsImage or +nifti +object to a target

    +
    + +
    resample_to_target(
    +  img,
    +  target,
    +  interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
    +    "cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
    +    "lanczosWindowedSinc", "genericLabel"),
    +  copy_origin = FALSE,
    +  ...
    +)
    +
    +# S4 method for character
    +resample_to_target(
    +  img,
    +  target,
    +  interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
    +    "cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
    +    "lanczosWindowedSinc", "genericLabel"),
    +  copy_origin = FALSE,
    +  ...
    +)
    +
    +# S4 method for nifti
    +resample_to_target(
    +  img,
    +  target,
    +  interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
    +    "cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
    +    "lanczosWindowedSinc", "genericLabel"),
    +  copy_origin = FALSE,
    +  ...
    +)
    +
    +# S4 method for antsImage
    +resample_to_target(
    +  img,
    +  target,
    +  interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
    +    "cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
    +    "lanczosWindowedSinc", "genericLabel"),
    +  copy_origin = FALSE,
    +  ...
    +)
    +
    +.resample_to_target(
    +  img,
    +  target,
    +  interpolator = c("linear", "nearestNeighbor", "multiLabel", "gaussian", "bSpline",
    +    "cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
    +    "lanczosWindowedSinc", "genericLabel"),
    +  copy_origin = FALSE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    img

    character path of image or +an object of class nifti, or antsImage

    target

    image of reference, +the output will be in this space. +Will be coerced using check_ants

    interpolator

    what type of interpolation should be +done

    copy_origin

    Copy image origin from target, +using antsCopyOrigin

    ...

    additional arguments to pass to +resampleImageToTarget

    + +

    Value

    + +

    An antsImage or nifti depending on +input

    + +

    Examples

    +
    library(oro.nifti) +library(extrantsr) +n = 30 +x = nifti(array(rnorm(n^3*10), dim = c(n, n, n))) +new_pixdim = c(0.5, 0.5, 0.5) +res = resample_image(x, parameters = new_pixdim) +x2 = resample_to_target(x, res) +pixdim(x2)[2:4]
    #> [1] 0.5 0.5 0.5
    stopifnot(all(pixdim(x2)[2:4] == new_pixdim))
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/robust_brain_mask.html b/docs/reference/robust_brain_mask.html new file mode 100644 index 0000000..20f2790 --- /dev/null +++ b/docs/reference/robust_brain_mask.html @@ -0,0 +1,219 @@ + + + + + + + + +Robust Brain Mask from Template — robust_brain_mask • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Masks the brain from scan using a rigid body transformation +of the template mask to the native brain space and then inflating the mask +to adjust for mis-registration.

    +
    + +
    robust_brain_mask(
    +  file,
    +  template.file,
    +  template.mask = NULL,
    +  nvoxels = 7,
    +  ret_mask = FALSE,
    +  typeofTransform = "Rigid",
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    File for masking - either filename or class nifti

    template.file

    Template to warp to original image space

    template.mask

    Mask of template to use as rough brain mask. If +template.file is specified, but template.mask is not, +then fslbin(file=template.file) is performed.

    nvoxels

    Number of voxels in nxnxn direction to inflate, see +fslmaths.help for -kernel boxv n -dilM.

    ret_mask

    Return mask of robust brain

    typeofTransform

    Transformation for template to image, passed to +ants_regwrite.

    verbose

    Print diagnostic progress

    ...

    Arguments passed to ants_regwrite

    + +

    Value

    + +

    Object of class nifti or vector of indices

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/scaled_neighborhood.html b/docs/reference/scaled_neighborhood.html new file mode 100644 index 0000000..3e0c42b --- /dev/null +++ b/docs/reference/scaled_neighborhood.html @@ -0,0 +1,213 @@ + + + + + + + + +Get Scaled Neighborhood of Voxels from an Image — scaled_neighborhood • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps the neighborhood to +provided scaled neighborhood or its ranks

    +
    + +
    scaled_neighborhood(
    +  img,
    +  mask = NULL,
    +  radius = rep(1, 3),
    +  method = c("pearson", "spearman"),
    +  center = TRUE,
    +  scale = TRUE,
    +  verbose = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Object of class nifti, character or antsImage

    mask

    Binary image of class nifti, +antsImage, character. Only neighborhoods inside the mask +will be taken

    radius

    vector of length 3 for number of voxels to go in each direction. +Default is 27 neighbors (including voxel at center). +Passed to getNeighborhoodInMask.

    method

    If pearson, scaling done on original data. If spearman, +the ranks.

    center

    Should the data be centered

    scale

    Should the data be scaled

    verbose

    print diagnostic messages

    + +

    Value

    + +

    List similar to the output of getNeighborhoodInMask

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/sim.html b/docs/reference/sim.html new file mode 100644 index 0000000..3e99946 --- /dev/null +++ b/docs/reference/sim.html @@ -0,0 +1,180 @@ + + + + + + + + +Calculate Overlap Metrics — sim • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Calculates perofrmance metrics, like dice, Jaccard, +sensitivity, specificity

    +
    + +
    sim(dman, dauto)
    + +

    Arguments

    + + + + + + + + + + +
    dman

    vector of manually delineated values

    dauto

    vector of automatically delineated values

    + +

    Value

    + +

    List of performance measures

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/smooth_image.html b/docs/reference/smooth_image.html new file mode 100644 index 0000000..ccdb044 --- /dev/null +++ b/docs/reference/smooth_image.html @@ -0,0 +1,228 @@ + + + + + + + + +Gaussian smooth image using ANTsR — smooth_image • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function calls smoothIamge to smooth an image and either +saves the image or returns an object of class nifti

    +
    + +
    smooth_image(
    +  file,
    +  sigma = 10,
    +  mask = NULL,
    +  smooth_mask = TRUE,
    +  smoothed_mask = NULL,
    +  verbose = TRUE,
    +  retfile = FALSE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    file

    (character) image to be smoothed

    sigma

    (numeric) sigma (in mm) of Gaussian kernel for smoothing

    mask

    (character) optional mask given for image

    smooth_mask

    (logical) Smooth mask? If TRUE, the masked image +will be divided by the smoothed mask.

    smoothed_mask

    (character or antsImage) If specified and +smooth_mask = TRUE, then will use this as the smoothed mask for +division.

    verbose

    (logical) print out command before running

    retfile

    logical to indicate if an antsImage should be returned +(useful for chaining)

    ...

    additional arguments passed to smoothImage.

    + +

    Value

    + +

    Object of class nifti

    + +

    Examples

    +
    system.time({ +library(oro.nifti) +dims = c(50, 50, 50) +x = array(rnorm(prod(dims)), dim = dims) +img = nifti(x, dim= dims, +datatype = convert.datatype()$FLOAT32, cal.min = min(x), +cal.max = max(x), pixdim = rep(1, 4)) +s.img = smooth_image(img, sigma = 3, sigmaInPhysicalCoordinates = TRUE) +})
    #> user system elapsed +#> 0.839 0.029 1.010
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/smri_preproc.html b/docs/reference/smri_preproc.html new file mode 100644 index 0000000..f4192a1 --- /dev/null +++ b/docs/reference/smri_preproc.html @@ -0,0 +1,221 @@ + + + + + + + + +Standard MRI Preprocessing — smri_preproc • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs robust skull stripping on the +T1, then preprocessing within visit

    +
    + +
    smri_preproc(
    +  files,
    +  window = FALSE,
    +  outfiles = NULL,
    +  maskfile = NULL,
    +  correct = TRUE,
    +  correction = "N4",
    +  correct_after_mask = TRUE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    files

    filenames (or nifti objects) of images to be processed. +Will register to the first scan

    window

    Should robust_window before running?

    outfiles

    (character) name of output files, with extension

    maskfile

    Filename (or nifti object) of mask for image to be +registered to

    correct

    do Bias field correction

    correction

    (character) N3 or N4 correction?

    correct_after_mask

    Should the inhomogeneity correction be run +after masking.

    verbose

    Diagnostic messages

    ...

    arguments to preprocess_mri_within

    + +

    Value

    + +

    List from preprocess_mri_within

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ss_bias.html b/docs/reference/ss_bias.html new file mode 100644 index 0000000..ab652cf --- /dev/null +++ b/docs/reference/ss_bias.html @@ -0,0 +1,242 @@ + + + + + + + + +Skull Strip then Bias Field Correct — ss_bias • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function wraps fslbet and +bias_correct, performing skull stripping first

    +
    + +
    ss_bias(
    +  filename,
    +  maskfile = NULL,
    +  outfile = tempfile(fileext = ".nii.gz"),
    +  skull_strip = TRUE,
    +  bet.opts = "",
    +  betcmd = "bet",
    +  correct = TRUE,
    +  correction = "N3",
    +  shrinkfactor = "4",
    +  retimg = TRUE,
    +  reorient = FALSE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    filename

    filename to be processed

    maskfile

    filename of masked to be passed in, otherwise bet is performed

    outfile

    output filename with extension (e.g. .nii.gz)

    skull_strip

    should skull stripping be done

    bet.opts

    options for fslbet

    betcmd

    bet command to be used see fslbet

    correct

    should n3 correction be done stripping be done

    correction

    correction method used see bias_correct

    shrinkfactor

    correction method used see n3BiasFieldCorrection

    retimg

    (logical) return image of class nifti

    reorient

    (logical) If retimg, should file be reoriented when read in? +Passed to readnii.

    verbose

    Diagnostic output

    ...

    passed to bias_correct

    + +

    Value

    + +

    Filename of output file or object of class nifti

    +

    See also

    + + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/stat_img.html b/docs/reference/stat_img.html new file mode 100644 index 0000000..225d144 --- /dev/null +++ b/docs/reference/stat_img.html @@ -0,0 +1,215 @@ + + + + + + + + +Create Statistics Image — stat_img • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Creates output from a list of images, performing voxel-wise +operations to create a statistic image

    +
    + +
    stat_img(
    +  imgs,
    +  func = c("mean", "median", "mode", "pct", "peak", "sd", "var", "mad", "sum", "prod",
    +    "z", "quantile", "staple_prob", "staple_label"),
    +  finite = TRUE,
    +  masks = NULL,
    +  na_masks = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    imgs

    Character vector, list of characters, or object of class +nifti

    func

    Function to perform voxel-wise on list of images

    finite

    Should non-finite values be removed?

    masks

    Character vector, list of characters, or object of class +nifti same length as images.

    na_masks

    if masks are given, should values of 0 be +turned into NA?

    ...

    Addictional arguments to pass to func

    + +

    Value

    + +

    Object of class nifti

    +

    Note

    + +

    When func = "mode", the data is tabulated and then +max.col is run. The user can pass ties.method to +determine how to break ties. The default is "first" as compared to +max.col where it is "random". When func = "peak", +density is run on each voxel and the value with the maximum. If +the number of unique values is only 1, that value is returned.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/subset_4d-methods.html b/docs/reference/subset_4d-methods.html new file mode 100644 index 0000000..eab0f36 --- /dev/null +++ b/docs/reference/subset_4d-methods.html @@ -0,0 +1,226 @@ + + + + + + + + +Subset a 4D image — subset_4d-methods • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Subsets an antsImage or nifti +object from 4D

    +
    + +
    subset_4d(img, ind, ...)
    +
    +# S4 method for character
    +subset_4d(img, ind, ...)
    +
    +# S4 method for nifti
    +subset_4d(img, ind, ...)
    +
    +# S4 method for antsImage
    +subset_4d(img, ind, ...)
    +
    +.subset_4d(img, ind)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    img

    character path of image or +an object of class nifti, or antsImage

    ind

    subset indexers for the 4th dimension (usually time)

    ...

    Arguments passed to copyNIfTIHeader or +antsCopyImageInfo

    + +

    Value

    + +

    An antsImage or nifti depending on +input

    + +

    Examples

    +
    library(oro.nifti) +n = 20 +x = nifti(array(rnorm(n^3*10), dim = c(n, n, n, 10))) +ind = 2:3 +subset_4d(x, ind)
    #> NIfTI-1 format +#> Type : nifti +#> Data Type : 2 (UINT8) +#> Bits per Pixel : 8 +#> Slice Code : 0 (Unknown) +#> Intent Code : 0 (None) +#> Qform Code : 0 (Unknown) +#> Sform Code : 0 (Unknown) +#> Dimension : 20 x 20 x 20 x 2 +#> Pixel Dimension : 1 x 1 x 1 x 1 +#> Voxel Units : Unknown +#> Time Units : Unknown
    subset_4d(x, ind = 1)
    #> NIfTI-1 format +#> Type : nifti +#> Data Type : 2 (UINT8) +#> Bits per Pixel : 8 +#> Slice Code : 0 (Unknown) +#> Intent Code : 0 (None) +#> Qform Code : 0 (Unknown) +#> Sform Code : 0 (Unknown) +#> Dimension : 20 x 20 x 20 +#> Pixel Dimension : 1 x 1 x 1 +#> Voxel Units : Unknown +#> Time Units : Unknown
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/tempants.html b/docs/reference/tempants.html new file mode 100644 index 0000000..c506388 --- /dev/null +++ b/docs/reference/tempants.html @@ -0,0 +1,185 @@ + + + + + + + + +Create temporary nii.gz file from antsImage — tempants • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Takes in a object of class antsImage, +writes it to a temp file, and appends .nii or .nii.gz

    +
    + +
    tempants(x, gzipped = TRUE, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    x

    object of class antsImage

    gzipped

    logical if the tempfile should be gzipped or not

    ...

    additional arguments to pass to tempimg +if nifti object

    + +

    Value

    + +

    Character value of filename

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/transformlist_from_outprefix.html b/docs/reference/transformlist_from_outprefix.html new file mode 100644 index 0000000..614320b --- /dev/null +++ b/docs/reference/transformlist_from_outprefix.html @@ -0,0 +1,204 @@ + + + + + + + + +Get list of transforms that would likely be made with a specific `outprefix` — transformlist_from_outprefix • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Get list of transforms that would likely be made with a specific `outprefix`

    +
    + +
    transformlist_from_outprefix(
    +  outprefix,
    +  typeofTransform = "SyN",
    +  only_exists = FALSE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    outprefix

    If you used this in antsRegistration, then +what would be the filenames of the transforms

    typeofTransform

    transformation to be used in registration

    only_exists

    if TRUE, only those that exists will be returned.

    + +

    Value

    + +

    A list of character vectors

    + +

    Examples

    +
    outprefix = tempfile() +transformlist_from_outprefix(outprefix)
    #> $fwdtransforms +#> [1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d1Warp.nii.gz" +#> [2] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d0GenericAffine.mat" +#> +#> $invtransforms +#> [1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d0GenericAffine.mat" +#> [2] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d1InverseWarp.nii.gz" +#>
    transformlist_from_outprefix(outprefix, typeofTransform = "Rigid")
    #> $fwdtransforms +#> [1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d0GenericAffine.mat" +#> +#> $invtransforms +#> [1] "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpZAwKcw/file78c84ac27a3d0GenericAffine.mat" +#>
    res = transformlist_from_outprefix(outprefix, typeofTransform = "Rigid", +only_exists = TRUE) +stopifnot(is.null(res))
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/within_visit_registration.html b/docs/reference/within_visit_registration.html new file mode 100644 index 0000000..7c5f60f --- /dev/null +++ b/docs/reference/within_visit_registration.html @@ -0,0 +1,203 @@ + + + + + + + + +Within Visit Registration — within_visit_registration • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    This function performs registration to a T1 template +using ANTsR and SyN transformation

    +
    + +
    within_visit_registration(
    +  fixed,
    +  moving,
    +  outfiles = NULL,
    +  typeofTransform = "Rigid",
    +  interpolator = "Linear",
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    fixed

    filename of fixed image to be registered to.

    moving

    filenames (or nifti) of images to register to fixed image

    outfiles

    Output filenames, same length as moving

    typeofTransform

    Transformation of moving to fixed image

    interpolator

    Interpolation to be done

    ...

    additional arguments to registration

    + +

    Value

    + +

    List of results from registration

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/write_transformlist.html b/docs/reference/write_transformlist.html new file mode 100644 index 0000000..b045d46 --- /dev/null +++ b/docs/reference/write_transformlist.html @@ -0,0 +1,174 @@ + + + + + + + + +Read Transform List from ANTsR — write_transformlist • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Transform a transformlist from ANTsR into an object in R

    +
    + +
    write_transformlist(transformlist)
    + +

    Arguments

    + + + + + + +
    transformlist

    List of transform elements

    + +

    Value

    + +

    List of transforms

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/zero_pad.html b/docs/reference/zero_pad.html new file mode 100644 index 0000000..77c811b --- /dev/null +++ b/docs/reference/zero_pad.html @@ -0,0 +1,179 @@ + + + + + + + + +Zero pads an image — zero_pad • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Zero pads an image

    +
    + +
    zero_pad(img, ...)
    + +

    Arguments

    + + + + + + + + + + +
    img

    Array, class nifti, or +antsImage

    ...

    Options to zero_pad

    + +

    Value

    + +

    Object of class nifti, array, or antsImage

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.5.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/zscore_template.html b/docs/reference/zscore_template.html new file mode 100644 index 0000000..aa89eb3 --- /dev/null +++ b/docs/reference/zscore_template.html @@ -0,0 +1,237 @@ + + + + + + + + +Create Z-score-to-Template Image — zscore_template • extrantsr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Registers an image to a template, subtracts a mean and sd image, and +will return the image either in template space or native.

    +
    + +
    zscore_template(
    +  img,
    +  template.file,
    +  mean.img,
    +  sd.img,
    +  outfile = NULL,
    +  typeofTransform = "SyN",
    +  interpolator = "Linear",
    +  robust = TRUE,
    +  probs = c(0, 0.999),
    +  native = TRUE,
    +  verbose = TRUE,
    +  ...
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    img

    Image to be z-scored

    template.file

    Template file to be registered to. An affine registration +will be done usually, so if the image is skull-stripped, use a skull-stripped +template and vice versa

    mean.img

    Mean image to be subtracted

    sd.img

    SD image to be divded

    outfile

    Output filename. Will use writenii to write

    typeofTransform

    Transform for registration. See antsRegistration

    interpolator

    Interpolator to use, See antsRegistration

    robust

    Should See robust_window be used on the image

    probs

    quantiles to constrain the image these define the window sent +to robust_window

    native

    Should a native-space image (default) or template-space image +be returned

    verbose

    Print diagnostic output

    ...

    Options passed to ants_regwrite.

    + +

    Value

    + +

    Object of class nifti

    + +
    + +
    + + + +
    + + + + + + + + diff --git a/extrantsr.Rproj b/extrantsr.Rproj index a1483a8..5fd1ea6 100644 --- a/extrantsr.Rproj +++ b/extrantsr.Rproj @@ -16,5 +16,5 @@ BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source PackageBuildArgs: --resave-data -PackageCheckArgs: --as-cran --no-build-vignettes +PackageCheckArgs: --as-cran --no-build-vignettes --run-donttest PackageRoxygenize: rd,collate,namespace diff --git a/man/face_removal_mask_ants.Rd b/man/face_removal_mask_ants.Rd index a6630f1..ff606e0 100644 --- a/man/face_removal_mask_ants.Rd +++ b/man/face_removal_mask_ants.Rd @@ -44,7 +44,7 @@ Face Removal Mask using ANTs Registration } \examples{ \donttest{ -if (have_fsl()) { +if (fslr::have_fsl()) { file = "~/Downloads/sample_T1_input.nii.gz" if (file.exists(file)) { mask = face_removal_mask_ants(file = file, diff --git a/vignettes/brain_extract_files/figure-html/t1_naive_plot-1.png b/vignettes/brain_extract_files/figure-html/t1_naive_plot-1.png deleted file mode 100644 index 32b1dd4..0000000 Binary files a/vignettes/brain_extract_files/figure-html/t1_naive_plot-1.png and /dev/null differ diff --git a/vignettes/brain_extract_files/figure-html/t1_plot-1.png b/vignettes/brain_extract_files/figure-html/t1_plot-1.png deleted file mode 100644 index 863348d..0000000 Binary files a/vignettes/brain_extract_files/figure-html/t1_plot-1.png and /dev/null differ