Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{section}
{column:width=65%}{panel:title=Contents of this Page}{toc:minLevel=2}{panel}{column}
{column}{include:Menu cTAKES 3.0 to Include}{column}
{section}

|| WARNING: Newer instructions ||
| NOTE: The information here is largely for the ctakes 2.5 build process (eclipse based with some ant).  ctakes 3.x under apache now uses a maven based build process.  Please see the following web site for current build instructions: [http://incubator.apache.org/ctakes/3.0.0/developer-guide-3.0] |
| (should these instructions be copied into this wiki page?) \\  {color:#ff6600}Y{color}{color:#ffcc00}{*}ES\! The original contents were just a start to the page and it should be changed over into what it takes now for 3.0.*{color} \\
The user doc and the developer doc that started on the incubator site should both be moved here and the main site should point to this doc. The same groups should be covered, meaning developers using Eclipse or the command line. \\ |

These are instructions for installation of cTAKES for developers. With these instructions you can set up your development environment with cTAKES code, change or extend the code, compile the code, and deploy. If you simply want to be a user of the software, refer to the [cTAKES 3.0 User Guide].

Knowledge about what the cTAKES components do is not supplied by the install instructions. This is found in the [cTAKES 3.0 Component Use Guide]. There is no training or documentation (except for code comments) on the code itself. You must familiarize yourself with the components and then study the code on your own to be able to extend it.

In order to modify/compile the source code for a cTAKES component, developers must utilize either an IDE, such as Eclipse, or another editor of your choice. Follow the appropriate sections here depending upon your developer preferences.

Once you have compiled the code you can process documents with the cTAKES components. The documents upon which you can run cTAKES will take many forms. An example of doing this is covered in the Processing Documents section.

The expert instructions below are short and require a lot of prerequisite setup on your own. If you need more help then follow the step by step instructions.

h2. Eclipse

h3. Expert install instructions

Prerequisites: Java JDK 1.6+, Eclipse IDE 4.2+, subversive plugin (or svn equivalent with appropriate SVN team provider connectors), m2e plugin (or mvn equivalent)

* Import Project > Maven > Checkout Maven Project from SCM and use: svn:{nolink:https://svn.apache.org/repos/asf/incubator/ctakes/trunk}
* Select all projects.
* Wait until Eclipse downloads and builds all of your projects (it may take up to 30 minutes depending on the machine).
** The various build helpers should run jcasgen and builds the projects for you. There should not be any reason to run mvn install, etc.
* (Optional) If you would like to launch the UIMA CVD or CPE GUI, run ctakes-clinical-pipeline/resources/launch/UIMA_<CVD \| CPE>GUI--clinical_documents pipeline.launch

h3. Step by step install instructions (for Eclipse)

h4. Preparing Java

|| Step || Example ||
| 1. All forms of development require the Java SDK 1.6+. You can get it from [java.com|http://www.java.com/en/download/faq/develop.xml]. \\
\\
Make sure you get the proper version and install the SDK not just the Java Runtime environment. \\
\\
To check if you have the SDK, look in the lib directory of the Java install and see if the file tools.jar is there. If there is a lib directory and there is a file by that name then you have the SDK. \\
\\
To check if you have the proper version. Enter the command: \\
*Windows* and *Linux*: {code:language=none}java -version{code} \\
on any command line to see what version you have now. | {code:language=none}C:\>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
{code} |
| 2. It is possible that some commands and programs can find the Java runtime that you want to be used but it is best to set the JAVA_HOME environment variable. Set the value of JAVA_HOME to the absolute path of the root of the Java Runtime environment that you want UIMA and cTAKES to use. \\
*Windows*: \\
Right-click on *Computer* > *Properties* > *Advanced System Settings* > *Advanced* tab > *Environment Variables* button > *New* button for System variables. Once the values are entered click *OK* until you are out of the dialog series. \\
*Linux*: \\  {code:language=none}export JAVA_HOME=<path>
{code} | !worddavad2a112316c122012a78bd4e3eb1bc3b.png! |

h4. Preparing Eclipse

If you are going to use Eclipse for development then follow these instructions.

|| Step || Example ||
| 1. Download and install [Eclipse|http://eclipse.org/] 4.2+. \\
\\
(optional) It is recommended that you start a new workspace to keep your cTAKES projects separate from other work. | No example |
| 2. Subversion Eclipse plug-in. \\
 We will use the one called "Subversive - SVN Team Provider" \\
 [http://www.eclipse.org/subversive/documentation/gettingStarted/aboutSubversive/install.php\\
] \\
Help \-> Install New Software... \\
 Select the current Eclipse release (in the case of Eclipse 4 it is Juno) for the "Work with" field: Juno - [http://download.eclipse.org/releases/juno\\
] Expand the Collaboration category. \\
 Select "Subversive SVN Team Provider". \\
 Click Next. \\
 Agree to the license. \\
 Click Finish. \\
 Restart Eclipse. \\ | |
| 3. Subversion team provider connectors 1.7+. \\
 After restarting Eclipse a dialog will ask you to install these. Select SVN Kit 1.7 or greater. \\
 Click Finish. \\
 Click Next. \\
 Agree to the license. \\
 Click Finish. \\
 Accept the security warning (if one appears). \\
 Restart Eclipse. \\ | |
| 4. Maven is already part of Eclipse, but more integration to Maven commands is needed. \\
 \\
Help \-> Install New Software... \\
 Select the current Eclipse release  (in the case of Eclipse 4 it is Juno) for the "Work with" field: Juno -  [http://download.eclipse.org/releases/juno\\
] Expand the Collaboration category. \\
 Select "m2e - Maven Integration for Eclipse". \\
 Click Next. \\
 Click Finish. \\
 Restart Eclipse. \\ | |

h3. Compile the latest stable release in Eclipse

A
|| testedStep and|| stable release is delivered as a ZIP file. The cTAKES source code is included in the file as well as UIMA.

|| Step || Example ||
| 1. Navigate to the source downloads for a[released version on SourceForge.netExample ||
| 1. Import the cTAKES projects using Maven.\\
 File \-> Import ... \-> Maven \-> Check out Maven Projects from SCM.\\
 Click Next.\\
 For SCM URL use SVN in the drop-down and {nolink:https://svn.apache.org/repos/asf/incubator/ctakes/trunk} in the text field.
[|http://sourceforge.net/projects/ohnlp/files/cTAKES] | Even without the full LVG data, cTAKES is about 790 MB when compressed.\\ |
| 2. Download the latest version. \\
\\
Select the directory for the latest version and download the \*ZIP*file. | !cTAKES-3.0-download-progress.jpg! |
| 3. \\
Unzip the file you downloaded into a directory that you want to be the \\
cTAKES install location. It will expand to about 1.4GB. \\
*Windows*: {code:language=none}c:\cTAKES-3.0
{code} \\
*Linux*: {code:language=none}/usr/bin/cTAKES-3.0{code}\\
\\
This folder we will call *<cTAKES_HOME>*. You will need to refer to the directory later. | !cTAKES-3.0-Extracting.jpg!\| |
| 4. Set *UIMA_HOME*. UIMA requires a special environment variable for its commands to run. \\
\\
Use the absolute path to the <cTAKES_HOME> directory in the previous step as the value. \\
\\
*Windows*: \\
Right-click on *Computer*> *Properties*> *Advanced*> \*Environment Variables*button > \*New*button for System variables. Keep clicking \*OK*until you are out of the dialog series. \\
*Linux*: \\
Use the command export UIMA_HOME=<cTAKES_HOME> for example: \\
{code:language=none}export UIMA_HOME=/usr/bin/cTAKES-3.0
{code} | !worddav3888bf7b1a7c2ba16142c311278d27d5.png! |
| 5. Edit *PATH*. This will be used for any command line access to binaries. \\
*Windows:* \\
Right-click on *Computer*> *Properties*> *Advanced*> \*Environment Variables*button. Edit the \*Path*environment variable adding \*;<cTAKES_HOME>\bin*to the end. Keep clicking \*OK*until you are out of the dialog series. \\
*Linux:* \\
Use the command export PATH=%PATH%:<cTAKES_HOME>/bin for example \\
{code:language=none}export PATH=%PATH%:/usr/bin/cTAKES-3.0/bin
{code} | !worddav77312787f8b2a33f972e353bd4904029.png! |
| 6. In Eclipse use *File* > *New* > *Java Project ...* \\
\\
Uncheck *Use default location*and navigate to \*<cTAKES_HOME>*for location Click \*Next>*Click \*Finish*. | !CreateNewJavaProject-cTAKES-3.0.jpg!\\  !worddava8b9c1b9055a21929171aff87425b80b.png! |
| 7. Remove unnecessary JAR files. \\
\\
Go to *Project*> *Properties*> *Java Build Path*> *Libraries*. Select all the entries except the JRE System Library and click the \*Remove*button. | !worddavd058913661c88e864f065b8160533651.png! \\ |
| 8. Add cTAKES folders as class resources. \\
\\
Select *Add Class Folder*. Check the two class folders *cTAKESdesc*and \*resources*. Click *OK*. | !worddav23d0154e8a5d4631d0cc0ca5b4656df7.png! \\ |
| 9. Add JAR files from <cTAKES_HOME>/lib. \\
\\
Select *Add Library*button > \*User Library*list item > \*Next >*button > \*User Libraries*button > \*New*button. Name the new user library \*ctakes3.0lib*and click \*OK*. Click the *Add JARs...*button and Navigate to <cTAKES_HOME>*\lib*. Select all the JAR files and click *Open*. Click *OK*. Click *Finish*. | !worddav0c53fc959ccff3a3de5b8275a14911b4.png! \\ |
| 10. Close the User Libraries dialog. \\
\\
Click *OK*. Your Package Explorer should look something like this (next cell). | !worddav32937c618e242961277b1349c803a30b.png! \\
\\  !worddavc675ac4917b181d3c80ab464ced3f0a8.png!\\ |
| 11. If you have Eclipse set to build automatically it will do so and you may continue to run and debug from Eclipse. \\
\\
You can also setup Eclipse to run Ant builds using the Ant files shipped as seen on the right (next cell). | !worddave60ad198169babf17f5e5a1b4a03b8a7.png! |

h3. Compile a development release from SVN in Eclipse

If you know what you are doing with the cTAKES code and you must get the latest code currently under development (potentially unstable), then you need to use an SVN connection to retrieve the code.

|| Step || Example ||
| 1. Install [subversion|http://subversion.apache.org/] or a suitable plug-in for your IDE. | No example |
| 2. Check-out the code to a local directory, such as: \\
{code:language=none}c:\cTAKES-3.0{code} \\
This folder we will call *<cTAKES_HOME>*. You will need to refer to the directory later. \\
Pre-release versions are available from: \\
{code:language=none}svn checkout https://ohnlp.svn.sourceforge.net/svnroot/ohnlp/trunk/cTAKES{code} \\
{note}If you are checking out via Subclipse in Eclipse, make sure to check out each project separately.{note} | {code:language=none}...
A cTAKES\PAD term spotter\desc\type_system
A cTAKES\PAD term spotter\desc\type_system\PADSiteAndTerm.xml
A cTAKES\PAD term spotter\desc\analysis_engine
A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_TermSpotterAnnotatorTAEStyleMap.xml
A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_TermSpotterAnnotatorTAE.xml
A cTAKES\PAD term spotter\desc\analysis_engine\DxStatusAnnotator.xml
A cTAKES\PAD term spotter\desc\analysis_engine\NegationDxAnnotator.xml
A cTAKES\PAD term spotter\desc\analysis_engine\PAD_Hit.xml
A cTAKES\PAD term spotter\desc\analysis_engine\SubSectionBoundaryAnnotator.xml
A cTAKES\PAD term spotter\desc\analysis_engine\Radiology_DictionaryLookupCSVAnnotator.xml
A cTAKES\PAD term spotter\desc\collection_processing_engine
A cTAKES\PAD term spotter\desc\collection_processing_engine\Radiology_sample.xml
A cTAKES\PAD term spotter\desc\collection_reader
A cTAKES\PAD term spotter\desc\collection_reader\RadiologyRecordsCollectionReader.xml
A cTAKES\PAD term spotter\.settings
A cTAKES\PAD term spotter\.settings\org.eclipse.jdt.ui.prefs
Checked out revision 667.
{code} |
| 3. In Eclipse use *File* > *Import...* > *General* > *Existing Projects into Workspace* \\
\\
Use your local directory for the *root directory*. Leave all of the projects selected and click *Finish*. \\
\\
{note}It may be necessary to import each project one by one\!{note} | !cTAKES_Win_SVN_Import.jpg! |
| 4. Install [UIMA 2.4|http://uima.apache.org/downloads.cgi#Latest]. Make note of *UIMA_HOME*. | No example \\ |
| 5. Add UIMA JARs to the build path configuration in Eclipse. Add all JARs from: \\
{code}<UIMA_HOME>/lib{code} | * jVinci.jar
* uima-adapter-soap.jar
* uima-adapter-vinci.jar
* uima-core.jar
* uima-cpe.jar
* uima-documentation-annotation.jar
* uima-examples.jar
* uima-bootstrap.jar
* uima-tools.jar |

h3. Process documents using cTAKES

You can now launch or debug the cTAKES components that you have built. You could run commands from a command prompt, as found in the [user install instructions|????], but you can launch them from within Eclipse now instead. Launching the CAS Visual Debugger (CVD) and the Collection processing engine (CPE)  from Eclipse is as simple as following this step.
|| Step || Example ||
| 1. In Eclipse, launch the tools using their main program. \\
\\
Find in the Eclipse project: *src*\-> *edu.mayo.bmi.ctakes.main*> *cTAKESCPEGUI.java*or \*cTAKESCVDGUI.java*. Then use the Run menu to run or debug as desired. Using the tools does not change from what is documented in the [user install instructions|??????]. \\ | \\ |

h3. (Optional) UIMA tools plug-in (for Eclipse)

Developers may be interested in the Eclipse plug-ins provided by the UIMA community. For example, they include a UIMA component descriptor editor.

|| Step || Example ||
| 1. Find UIMA Eclipse plug-ins. \\
\\
*Help*> *Install New Software...*> *Add...* button \\
Set a repository name and this site location {code:language=none}http://www.apache.org/dist/uima/eclipse-update-site
{code} \\
Click *OK*. | !cTAKES_Win_UIMA_Repository.jpg! |
| 2. Install UIMA Eclipse plug-ins. \\
\\
Select the *UIMA Eclipse tooling and runtime support*. \\
Click \*Next >*and finish the install. \\
\\
Additional help can be found on the Apache site [UIMA for Eclipse on apache.org|http://uima.apache.org/downloads/releaseDocs/2.2.0-incubating/docs/html/overview_and_setup/overview_and_setup.html#ugr.ovv.eclipse_setup]. | !cTAKES_Win_UIMA_Repository_Install.jpg! |
| (optional) Verify the installation of the UIMA Plug-ins. Go to *Help*> *About Eclipse*> *Installation Details*> *Plug-ins*. You will see a dialog such as that on the right (next cell) with plug-in names starting with "UIMA Eclipse:". | !worddav3a092c610c917925d4c9a60bb7f5c4f1.png!\\ |

h2. Command line

h3. Expert install instructions

Prerequisites: Java JDK 1.6+, SVN, Maven 3.0\+
* svn co {nolink:https://svn.apache.org/repos/asf/incubator/ctakes/trunk} ctakes
* mvn clean compile package
** Running the mvn package command will generate a binary distribution in /ctakes-distribution/target/ctakes\-{release}
\-bin.tar.gz/zip
* (Optional) If you would like to launch the UIMA CVD or CPE GUI, run $ MAVEN_OPTS="-Xmx1g" mvn \-PrunCVD compile

For further information see the [Apache Source Code Repository|http://www.apache.org/dev/version-control.html] page.

h3. Step by step install instructions (for command line)

h4. Preparing Command Line Tools

If you are going to use command line only to compile then you will need these tools.

|| Step || Example ||
| 1. Navigate to the [Ant download site on apache.org|http://ant.apache.org/bindownload.cgi] and install Ant 1.7.1\+ | !worddav6ac9644911210be9ec0d31f976b3a43e.png! |
| 2. Download Ant 1.7.1+. Unzip the file you downloaded to a local directory. We will call this *<ANT_HOME>* Follow the [instructions for installing Ant on apache.org|http://ant.apache.org/manual/index.html]. This will include changing the PATH and ANT_HOME environment variables. | !worddavdadb04f2b5d0572cd89c121d1f0cfd97.png! \\
\\  !worddav733aa876fc1ef8135dd0dcdf17dbd87a.png! |

{info}
The UIMA command to generate the type system through the command line (JCasGen) is not shipped with cTAKES at this time. The common type system has already been generated for you. If you need, for some reason, to generate this then you will need to use the method described for Eclipse or install the entire UIMA SDK.{info}

|| Step || Example ||
| 1. Follow the first steps of the "Compile the latest stable release in Eclipse" (which do not require Eclipse) until you get to the part about creating a new project in Eclipse. | No example |
| 2. Obtain the relevant build.xml file from SVN, placing it into <cTAKES_HOME> \\
\\
It can be found at [https://ohnlp.svn.sourceforge.net/svnroot/ohnlp/trunk/icTAKES/build.xml] \\
Be aware there are multiple build.xml files in SVN. be sure to use the one listed above | No example |
| 3. To compile cTAKES, change to the <cTAKES_HOME> directory and simply run: {code:language=none}ant{code} | No example |

h3. Process documents using cTAKES