|
Size: 2666
Comment: Added DICOM position tag information.
|
Size: 1755
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| #pragma section-numbers on | #acl LcnGroup:read,write,delete,revert All:read |
| Line 3: | Line 3: |
| = Index = | = FreeSurfer Dev Guide = |
| Line 5: | Line 5: |
| [[Navigation(children)]] [[TableOfContents]] |
* Visit the BuildGuide for instructions on building and installing freesurfer manually. * Visit the GitHub page for an introduction to the github workflow. * Visit the GitAnnex page for detailed instructions on using git annex for storing and retrieving large data files in the repository. |
| Line 8: | Line 9: |
| = File Format Information = | == Adding a New C Program == |
| Line 10: | Line 11: |
| == DICOM == === DICOM Resources === [http://medical.nema.org/dicom/2003.html DICOM specification] [[BR]] [http://dclunie.com/medical-image-faq/html/part8.html DICOM informtion sources] |
If you'd like to add a new program to the tree, you should create a new subdirectory with the title of your tool. As an example, let's create a new c++ program called `mri_process`. First, we'll create a top-level subdirectory that contains our new c++ file and an empty `CMakeLists.txt` file: |
| Line 15: | Line 13: |
| === DICOM Position/Orientation Information === DICOM uses a "Tag" to retrieve "Attribute Name" information. The documentation can be found in the [http://medical.nema.org/dicom/2003.html DICOM specification]. The image position and the image orientation section is in Part 3:Information Object Definition, C.7.6.1.1.1 and C.7.6.2.1.1. |
{{{ freesurfer/ mri_process/ CMakeLists.txt mri_process.cpp }}} |
| Line 18: | Line 20: |
| The DICOM coordinate system is the LPS (left-posterior-superior), meanwhile the RAS coordinate system is right-anterior-superior. | In order to configure our new code, we should add the following to the empty `CMakeLists.txt` file. |
| Line 20: | Line 22: |
| The tag for the image position is (0x20, 0x32) and returns the x, y, z position of the upper left-hand corner of the image (the center of the first voxel). | {{{ project(mri_process) |
| Line 22: | Line 25: |
| The tag for the image orientation is (0x20, 0x37) and it returns the direction cosines of the first row and the first column with respect to the patient: first the value for the row x, y, z and then the value for the column x, y, z. For example, I get the string of the form "0.00000\\1.00000\\0.00000\\0.00000\\0.00000\\-1.00000". | include_directories(${FS_INCLUDE_DIRS}) |
| Line 24: | Line 27: |
| The tag for the patient orientation is (0x20, 0x20) and it returns the position relative to the image plane by two characters with respect to the positive row axis (left to right) and the positive column axis (top to bottom). The character used are A(anterior), P(posterior), R(right), L(left), H(head), and F(foot). For example, the string I got was "P\\F" (posterior, foot). | add_executable(mri_process mri_process.cpp) target_link_libraries(mri_process utils) |
| Line 26: | Line 30: |
| install(TARGETS mri_process DESTINATION bin) }}} |
|
| Line 27: | Line 33: |
| == Medical Image Format FAQ == [http://www.dclunie.com/medical-image-faq/html Medical Image Format FAQ] = CVS Checkout = There are several ways to do: pserver, ext, kserver, gserver. See, e.g. Chapter 2 of [http://cvsbook.red-bean.com/cvsbook.html Open Source Development with CVS] by K. Fogel and M. Bar (2nd Edition, Coriolis Group, 2001). '''pserver''' `cvs -d :pserver:tosa@cvs.foobar.com:/space/repo/1/dev login` where username is "`tosa`" on the server "`cvs.foobar.com`". The cvs depository is `/space/repo/1/dev`. You get asked about the password. Once you stored your authentication in `.cvspass` file, you can run other CVS commands using a similar way. `cvs -d :pserver:tosa@cvs.foobar.com:/space/repo/1/dev co dev` which checkout the entire directory `dev` into the current directory. '''ext''' `export CVS_RSH=ssh` [[BR]] `cvs -d :ext:tosa@cvs.foobar.com:/space/repo/1/dev co dev` Note that even though CVS_RSH, we use `ssh`, which is a secure shell |
This will compile `mri_process.cpp`, link it against the `utils` freesurfer library, and copy the executable to the `$FREESURFER_HOME/bin` directory during install. To include this subdirectory in the main freesurfer build, make sure to modify the top-level `CMakeLists.txt` by adding `mri_process` to the long list of included directories at the bottom of the file. Now, after reconfiguring your build, you can run `make` in the `mri_process` directory of your build tree to successfully compile the new program. If you're having trouble configuring and building freesurfer, be sure to visit the BuildGuide for step-by-step instructions. |
FreeSurfer Dev Guide
Visit the BuildGuide for instructions on building and installing freesurfer manually.
Visit the GitHub page for an introduction to the github workflow.
Visit the GitAnnex page for detailed instructions on using git annex for storing and retrieving large data files in the repository.
Adding a New C Program
If you'd like to add a new program to the tree, you should create a new subdirectory with the title of your tool. As an example, let's create a new c++ program called mri_process. First, we'll create a top-level subdirectory that contains our new c++ file and an empty CMakeLists.txt file:
freesurfer/
mri_process/
CMakeLists.txt
mri_process.cppIn order to configure our new code, we should add the following to the empty CMakeLists.txt file.
project(mri_process)
include_directories(${FS_INCLUDE_DIRS})
add_executable(mri_process mri_process.cpp)
target_link_libraries(mri_process utils)
install(TARGETS mri_process DESTINATION bin)This will compile mri_process.cpp, link it against the utils freesurfer library, and copy the executable to the $FREESURFER_HOME/bin directory during install. To include this subdirectory in the main freesurfer build, make sure to modify the top-level CMakeLists.txt by adding mri_process to the long list of included directories at the bottom of the file. Now, after reconfiguring your build, you can run make in the mri_process directory of your build tree to successfully compile the new program. If you're having trouble configuring and building freesurfer, be sure to visit the BuildGuide for step-by-step instructions.
