Code Monkey home page Code Monkey logo

drawem's Introduction

Medical Image Registration ToolKit

Linux AppImage   Docker Image   Travis CI status   AppVeyor status   Join the chat at https://gitter.im/BioMedIA/MIRTK

The Medical Image Registration ToolKit (MIRTK) is a research-focused image processing toolkit, developed at the BioMedIA research group. It provides a collection of libraries and command-line tools to assist in processing and analyzing imaging data.

See the online documentation for more information.

Installation

See the installation instructions for a step-by-step guide on how to install the MIRTK.

License

The MIRTK is distributed under the terms of the Apache License Version 2. See the accompanying license file for details. The license enables usage of MIRTK in both commercial and non-commercial applications, without restrictions on the licensing applied to the combined work.

This directory includes source files and references to Git submodule repositories grouped and distributed under the GitHub MIRTK Organization, whose source files are covered by their own respective license terms. These licenses are compatible with the MIRTK license. See the download page for details.

Citation and acknowledgements

In the event you found the MIRTK useful, please consider giving appropriate credit to the software.

See the publications list for suitable citations.

drawem's People

Contributors

amakropoulos avatar aschuh-hf avatar jopasserat avatar schuhschuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

drawem's Issues

Use mirtk::ScalarGaussian of Numerics module

Remove mirtkGaussian.h and mirtkGaussian.cc files and use mirtk::ScalarGaussian class from Numerics module instead which implements the exact same thing. Possibly add missing default argument .0 for y_0 in argument list of constructor of mirtk::ScalarGaussian such that you can write

mirtk::ScalarGaussian gaussian(sigma, mu);

or add another constructor overload with two double arguments where the order is "mu, sigma".

Move generic image tools to Applications module

I would suggest moving the following tools to the Applications module while renaming and possibly extending them as follows:

  • calculate-filtering -> calculate-local-image-statistics.
  • calculate-gradients -> calculate-image-gradients, add option to use finite differences instead.
  • fill-holes -> fill-image-holes, add option to use NN as in fill-holes-nn-based instead of separate command.
    ...

Contribute classes copied from IRTK/image++ to MIRTK/Image module

Some of the IRTK image module classes you use were not refactored for the MIRTK before as they had not been used in any of my registration code. When we now, however, have a module that depends on these old IRTK classes, I would prefer having (refactored) versions of these in the MIRTK Image module.

Problem with dHCP Surface Template

Dear Expert,

I wanna display some nodes on the dHCP surface template provided in :
https://biomedic.doc.ic.ac.uk/brain-development/downloads/dhcp-neonatal-surface/
Actually, by merging both the right and the left hemisphere, they did not stand aside each other and form a complete brain. They have far distances from each other. Now, I am wonder if they are in the same space? Also, I attached an image, showing the merged hemispheres.
I would apprecaite if you could help me to put them aside each other.

Regards,
Mahshid
2Hemis

Remove ThirdParty/ITK folder

@amakropoulos Binary files shouldn't be in any source repository. It's also not so good to suggest that ITK would be included. I think DrawEM should be set up such that it can work with either an ITK N4 application or the respective command of the ANTs installation. But in either case, this is a pipeline dependency rather than a build/runtime dependency.

For a convenient installation of DrawEM for inexperienced users, it is better to later think about automating installation steps using CMake + Python.

error in tissue_priors.sh

Just installed the the feature/MCRIB_integrated branch

When running mirtk neonatal-segmentation there seems to be a problem with the conditions in tissue_priors.sh as the $age were not properly passed on to the registration and the processing was terminated.

First, a first solution was to update the lines 59-60 from

    [ $age -lt $TEMPLATE_MAX_AGE ] || { age=$TEMPLATE_MAX_AGE; }
    [ $age -gt $TEMPLATE_MIN_AGE ] || { age=$TEMPLATE_MIN_AGE; }

to

    [ $age -lt $TEMPLATE_MAX_AGE ] || { $age=$TEMPLATE_MAX_AGE; }
    [ $age -gt $TEMPLATE_MIN_AGE ] || { $age=$TEMPLATE_MIN_AGE; }

and then it runs but still complains about something in this lines. Here is the relevant output

register-multi-atlas.sh sub-PK343_ses-MR1_run-001_T2w 40 10
running /home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/scripts/tissue-priors.sh sub-PK343_ses-MR1_run-001_T2w 40 10
creating sub-PK343_ses-MR1_run-001_T2w tissue priors
/home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/scripts/tissue-priors.sh: line 59: [: 40: unary operator expected
/home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/scripts/tissue-priors.sh: line 59: 40=: command not found
/home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/scripts/tissue-priors.sh: line 60: [: 40: unary operator expected
/home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/scripts/tissue-priors.sh: line 60: 40=: command not found
mirtk register N4/sub-PK343_ses-MR1_run-001_T2w.nii.gz /home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/atlases/non-rigid-v2/T2/template-40.nii.gz -dofout dofs/sub-PK343_ses-MR1_run-001_T2w-tissue-atlas-40-n.dof.gz -parin /home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/parameters/ireg.cfg -threads 10 -v 0

drawEM installation

Hi,
I have been trying to install this module for the past couple of days and I am running into an issue, so I am hoping there is an easy fix to it :S
After changing the dependencies so that they fit the new MIRTK architecture (it is still dependent on ImageIO), I still cannot generate the project when I enable the drawEM module (I tried installing it with an older version of MIRTK and it still does not work).
I get:

CMake Error at CMake/Basis/TargetTools.cmake:1704 (_add_library):
Cannot find source file:

/home/me/Codes/MIRTK/MIRTK/Packages/DrawEM/include/m
irtk/mirtkBiasCorrection.h

Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
Call Stack (most recent call first):
CMake/Basis/TargetTools.cmake:2109 (add_library)
CMake/Basis/TargetTools.cmake:1079 (basis_add_library_target)
CMake/Modules/mirtkAddLibrary.cmake:52 (basis_add_library)
Packages/DrawEM/src/CMakeLists.txt:64 (mirtk_add_library)

CMake Error: CMake can not determine linker language for target: LibDrawEM

CMake Error in Packages/DrawEM/src/CMakeLists.txt:
Exporting the target "LibDrawEM" is not allowed since its linker language
cannot be determined

Do you have any idea how I could ix it?

Thanks!

VC build errors on Windows

"E:\MIRTK\MIRTK-build\Packages\DrawEM\src\LibDrawEM.vcxproj.metaproj" (Rebuild Ziel) (26:11) ->                                         
"E:\MIRTK\MIRTK-build\Packages\DrawEM\src\LibDrawEM.vcxproj" (Rebuild Ziel) (27:11) ->                                                  
(ClCompile Ziel) ->                                                                                                                     
  E:\MIRTK\MIRTK\Packages\DrawEM\src\DrawEM.cc(133): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-build\Packa 
ges\DrawEM\src\LibDrawEM.vcxproj]                                                                                                       
  E:\MIRTK\MIRTK\Packages\DrawEM\src\EMBase.cc(221): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-build\Packa 
ges\DrawEM\src\LibDrawEM.vcxproj]                                                                                                       
  E:\MIRTK\MIRTK\Packages\DrawEM\src\EMBase.cc(222): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-build\Packa 
ges\DrawEM\src\LibDrawEM.vcxproj]                                                                                                       
  E:\MIRTK\MIRTK\Packages\DrawEM\src\EMBase.cc(223): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-build\Packa 
ges\DrawEM\src\LibDrawEM.vcxproj]                                                                                                       
  E:\MIRTK\MIRTK\Packages\DrawEM\src\HashProbabilisticAtlas.cc(87): error C2131: expression did not evaluate to a constant [E:\MIRTK\MI 
RTK-build\Packages\DrawEM\src\LibDrawEM.vcxproj]                                                                                        
  E:\MIRTK\MIRTK\Packages\DrawEM\src\Gaussian.cc(28): error C2065: 'M_PI': undeclared identifier [E:\MIRTK\MIRTK-build\Packages\DrawEM\ 
src\LibDrawEM.vcxproj]                                                                                                                  
                                                                                                                                        
                                                                                                                                        
"E:\MIRTK\MIRTK-build\mirtk.sln" (Clean;Rebuild Ziel) (1) ->                                                                            
"E:\MIRTK\MIRTK-build\ALL_BUILD.vcxproj.metaproj" (Rebuild Ziel) (215:2) ->                                                             
"E:\MIRTK\MIRTK-build\Packages\DrawEM\tools\change-label.vcxproj.metaproj" (Rebuild Ziel) (181:3) ->                                    
"E:\MIRTK\MIRTK-build\Packages\DrawEM\tools\change-label.vcxproj" (Rebuild Ziel) (182:3) ->                                             
  E:\MIRTK\MIRTK\Packages\DrawEM\tools\change-label.cc(75): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-buil 
d\Packages\DrawEM\tools\change-label.vcxproj]                                                                                           
  E:\MIRTK\MIRTK\Packages\DrawEM\tools\change-label.cc(81): error C3863: array type 'int [N]' is not assignable [E:\MIRTK\MIRTK-build\P 
ackages\DrawEM\tools\change-label.vcxproj]                                                                                              
  E:\MIRTK\MIRTK\Packages\DrawEM\tools\change-label.cc(109): error C2131: expression did not evaluate to a constant [E:\MIRTK\MIRTK-bui 
ld\Packages\DrawEM\tools\change-label.vcxproj]                                                                                          
  E:\MIRTK\MIRTK\Packages\DrawEM\tools\change-label.cc(112): error C3863: array type 'double [N]' is not assignable [E:\MIRTK\MIRTK-bui 
ld\Packages\DrawEM\tools\change-label.vcxproj] 

Problem with atlases

Hi,

The link to the atlases needed for the segmentation don't lead me to an url where I can find the it.

Can you help me please ?

Thanks

setup.sh bugs

It seems that the two lines towards the end of setup.sh

echo "export DRAWEMDIR=$DRAWEMDIR" >> $code_dir/parameters/path.sh
echo "export PATH=${MIRTK_build}/bin:"'${PATH}' >> $code_dir/parameters/path.sh

attempt to write to a path that does not exist. Should the variables be $DRAWEMDIR instead of $code_dir?

atlases do not unzip in git master

Hello make install fails for atlases with git master. My guess is it's because it's now downloading a zip, but cmake is expecting a .tar.gz.

First, make succeeds with this output:

...
[ 48%] Linking CXX shared library ../../../lib/libMIRTKRegistration.so
[ 48%] Built target LibRegistration
Scanning dependencies of target atlases
[ 48%] Creating directories for 'atlases'
[ 48%] Performing download step (download, verify and extract) for 'atlases'
-- Downloading...
   dst='/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases-dhcp-structural-pipeline-v1.zip'
   timeout='none'
-- Using src='https://biomedic.doc.ic.ac.uk/brain-development/downloads/dHCP/atlases-dhcp-structural-pipeline-v1.zip'
-- [download 0% complete]
-- [download 1% complete]
...
-- [download 99% complete]
-- [download 100% complete]
-- verifying file...
       file='/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases-dhcp-structural-pipeline-v1.zip'
-- Downloading... done
-- extracting...
     src='/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases-dhcp-structural-pipeline-v1.zip'
     dst='/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 48%] No update step for 'atlases'
[ 50%] No patch step for 'atlases'
[ 50%] No configure step for 'atlases'
[ 50%] No build step for 'atlases'
[ 51%] No install step for 'atlases'
[ 51%] Completed 'atlases'
[ 51%] Built target atlases
Scanning dependencies of target atlases_move
[ 51%] Built target atlases_move
Scanning dependencies of target LibDrawEM
...

After make, /usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases looks like this:

root@df6c1e51575b:~# ls /usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src
atlases-build  atlases-dhcp-structural-pipeline-v1.zip  atlases-stamp

So the atlas downloaded, but it has not been unpacked. Perhaps cmake is expecting a .tar.gz rather than a zip?

When you run make install, it fails like this:

[ 48%] Built target LibRegistration
[ 51%] Built target atlases
Error renaming from "/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src/atlases" to "/usr/local/src/MIRTK/Packages/DrawEM/atlases": No such file or directory
Packages/DrawEM/CMakeFiles/atlases_move.dir/build.make:76: recipe for target 'Packages/DrawEM/CMakeFiles/atlases_move' failed
make[2]: *** [Packages/DrawEM/CMakeFiles/atlases_move] Error 1
CMakeFiles/Makefile2:1842: recipe for target 'Packages/DrawEM/CMakeFiles/atlases_move.dir/all' failed
make[1]: *** [Packages/DrawEM/CMakeFiles/atlases_move.dir/all] Error 2
Makefile:170: recipe for target 'all' failed
make: *** [all] Error 2

If I go in and unzip the atlases by hand:

root@df6c1e51575b:~# cd /usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src
root@df6c1e51575b:/usr/local/src/MIRTK/build/Packages/DrawEM/atlases/src# unzip -qq atlases-dhcp-structural-pipeline-v1.zip 

make install now succeeds.

Problem with labels-multi-atlas.sh

Hi,

When trying to segment an image, I get an error in the labels-multi-atlas.sh script saying:
Histogram1D::CDFToBin: Must be between 0 and 1
Error: normalize command returned non-zero exit status 1

It seems to be in the section: #weight atlas locally

Do you have any idea as to why I get this error?

Thanks!

Doesn't handle .nii file

Running the segmentation on an uncompressed T2_brain.nii file gives the following error:

Cifstream::Open: Cannot open file T2/T2_brain.nii.gz
Error: convert-image command returned non-zero exit status 1

Converting the .nii to a compressed .nii.gz format works normally. An unimportant error check to add in perhaps!

Installation not working

Hi,
is there an installer available for DrawEM? I tried for several hours to compile it from source by using setup.sh, but it always ended in some errors. Some dependencies are missing and when I try to install those, those are resulting in errors. An easier way to use DrawEM would be highly appreciated. Is there an installer or a docker image available?

linux installation

Hello,

I have difficulties installing MIRTK on linux (CentsOs 7) following the installation guide that is prepared for mac using cmake-gui. I've also download AppImage that is available for linux but it seems that image does not include DrawEM.

$ mirtk -v neonatal-segmentation Error: Missing executable for command: neonatal-segmentation Error: neonatal-segmentation command returned non-zero exit status 1
Could someone please give me a hint on how to install the mirtk under linux or add the DrawEM package to the AppImage?

Thank you!
Mahmoud

MCRIB atlas not downloaded to atlas folder

Hi,

Have installed the feature/MCRIB_integrated branch using the setup.sh script.

Now when I am running.

$mirtk neonatal-segmentation rawdata/sub-PK343/ses-MR1/anat/sub-PK343_ses-MR1_run-001_T2w.nii.gz 40 -atlas MCRIB -d derivatives/neonatal-segmentation_DrawEM_MCRIB/sub-PK343/ses-MR1 -t 10
ls: cannot access '/home/finn/Software/DrawEM/build/MIRTK/Packages/DrawEM/atlases/M-CRIB_2.0/T2': No such file or directory
DrawEM multi atlas  v1.3 (branch version: 820308892ccaceb821a17a8875a6abb3e19bed05)

it cannot find the MCRIB-atlas. In the appropriate location I only have the other atlases

finn@laptop:~/Software/DrawEM/build/MIRTK/Packages/DrawEM$ ls atlases/
ALBERTs  MNI  non-rigid-v2

I have previously downloaded it and have it in another location, but the folder names do no follow your convention, and comparing with the ALBERTs atlas I don't have any gm-posteriors etc etc.

How do I proceed?

Thanks!
Finn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.