Giter VIP home page Giter VIP logo

regnet's Issues

SimpleITK ReadImage error

RuntimeError: Exception thrown in SimpleITK ReadImage: C:\Users\dashboard\Miniconda3\conda-bld\simpleitk_1521730316398\work\Code\IO\src\sitkImageReaderBase.cxx:89:
sitk::ERROR: The file "/srv/2-lkeb-16-reg1/hsokooti/DL/Elastix/LungExp/ExpLung11/Result/MovingImageFullRS1.mha" does not exist.

ImportError: No module named 'functions.RegNetModel.crop1_connection'

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/markemus/dev/RegNet/RegNet3D.py", line 17, in <module>
    import functions.RegNetModel as RegNetModel
  File "/home/markemus/dev/RegNet/functions/RegNetModel/__init__.py", line 17, in <module>
    from .crop1_connection import crop1_connection
ImportError: No module named 'functions.RegNetModel.crop1_connection'

I got this error trying to run RegNet3D.py. Commenting those imports fixed the error, and grep doesn't show any usage for them.

patch concatenate

Hi, thank you for that your code have helped me a lot.
However, I am confused about some of your ideas, especially about patch.

  1. From the function “next_sweep_patch()” in functions.reading.real_pair, it seems that you get patches from image pair, and then concatenate these patches to form DVF. But this is easy to generate wrong correspondings between adjacent DVF. i.e. It's obvious that there are traces between patches in the final DVF. Like this:
    image

How to solve this problem?

  1. The input size in Function.RegNetModel.decimation3 is (155,155,155) and the output size is (27,27,27,3). Then the output is the DVF for the center part (27,27,27) in (155,155,155)?

Thanks a lot if you could answer my doubts.

Loading data?

Hi @hsokooti I'm having trouble figuring out how to preprocess and load data into the net. I saw your post linking some datasets, but the model seems to load *.mha files and they all seem to be in other formats. Additionally, I'm not sure where to put the data in the directory structure; the documentation seems to be outdated and the setting["DLFolder"] key doesn't exist anymore.

Code quality

Dear Hsokooti,

thanks for creating this repo. I have read your paper and it looks interesting... hence I would like to replicate it myself. However I do notice that (IMO) your code can be improved. Both in terms of readability as well as reduction in redundancy. Since I want to help to improve it, I would like to offer my suggestions. However I don't know how to 'post' these.. are you able to help me with that?

Besides that I have, for now, one question that I want to ask. In the script where you create synthetic DVFs, there is a option for blob() and smooth(). Both create a DVFb, but blob(), in addition, creates an DeformedArea surface.
As far as I could tell, the DVFb is introduced to transform one set of images to a transformed version. This fixed and moved image are then used to train the model.
However, I cant find where the DeformedArea object is used again. I believe you do show an image of that in the README.md, but I don't see that it transform some original image like DVFb does. Am I missing something?

estimates the DVF from a pair of input images

Thanks for sharing the source code which is super helpful for understanding the method. Based on my understanding the network takes patches as input. May I ask how to estimate the DVF during testing given a pair of input images, ideally in a single shot?

DIR-lab 4DCT dataset

I'm trying to load the DIR-lab 4DCT dataset, but I've run into some trouble.

I downloaded the dataset from dir-lab.com, and applied the following pre-processing steps:

-downloaded all 10 data sets.
-renamed *-ssm.img to *_s.img (to silence errors from dirlab.py).
-ran the dirlab.py module on the img files.
-copied the resulting mha directory to /srv/mymachine/hsokooti/Data/DIR-Lab/4DCT/.

However, running RegNet3D.py throws the following error:

[MainThread  ] ---------------------------------Fri Nov  9 11:21:44 2018--------------------------------
[MainThread  ] ----------------------------------start experiment------------------------------
[MainThread  ] number of images in the last chunk=12
[MainThread  ] SyntheticDeformation[generation]: start DIR-Lab_4D/3D_max7_D9//T40/case2/Dsmooth0/DNext3/nextIm.mha
[MainThread  ] Process Process-1:
[MainThread  ] Traceback (most recent call last):
[MainThread  ]   File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
[MainThread  ]     self.run()
[MainThread  ]   File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
[MainThread  ]     self._target(*self._args, **self._kwargs)
[MainThread  ]   File "/home/markemus/dev/RegNet/functions/reading/direct_1st_epoch.py", line 49, in run
[MainThread  ]     self.fill()
[MainThread  ]   File "/home/markemus/dev/RegNet/functions/reading/direct_1st_epoch.py", line 85, in fill
[MainThread  ]     mode_synthetic_dvf='generation'
[MainThread  ]   File "/home/markemus/dev/RegNet/functions/synthetic_deformation.py", line 63, in get_dvf_and_deformed_images
[MainThread  ]     generate_next_im(setting, im_info=im_info)
[MainThread  ]   File "/home/markemus/dev/RegNet/functions/synthetic_deformation.py", line 495, in generate_next_im
[MainThread  ]     original_im_sitk = sitk.ReadImage(su.address_generator(setting, 'originalIm', **im_info_su))
[MainThread  ]   File "/home/markemus/.local/lib/python3.5/site-packages/SimpleITK/SimpleITK.py", line 8614, in ReadImage
[MainThread  ]     return _SimpleITK.ReadImage(*args)
[MainThread  ] RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:89:
[MainThread  ] sitk::ERROR: The file "/srv/markemus-VirtualBox/hsokooti/Data/DIR-Lab/4DCT/mha/case2/case2_T40_RS1.mha" does not exist.
[MainThread  ] total number of variables 1116164
[Thread-4    ] SyntheticDeformation[reading]: waiting 5s for DIR-Lab_4D/3D_max7_D9//T40/case2/Dsmooth0/DNext3/nextIm.mha

Is there an additional/different preprocessing step I need to do? Renaming */case2_T40.mha to */case2_T40_RS1.mha seems to fix this error and creates a nextIm.mha file, but there are more errors after that.

where do we download data (SPREAD (Stolk et al., 2007) in your paper?

Dear @hsokooti and everyone,
I followed your paper and your paper used three datasets. They included:

  1. SPREAD (Stolk et al., 2007)
    1. DIR-Lab-4DCT and DIR-Lab-COPD

Where website can we download it? I also follow this link(https://www.resmedjournal.com/article/S0954-6111(07)00186-2/fulltext) but I don't know, how to download SPREAD (Stolk et al, 2007)? Please help me.
image

2)3) I download them from https://www.dir-lab.com/Downloads.html. okay with me.
Thank you, @hsokooti and everyone.

Performance issues in functions/registration/multi_stage.py(P2)

Hello,I found a performance issue in functions/registration/multi_stage.py ,
sess = tf.Session() was repeatedly called in for i_stage, stage in enumerate and was not closed.
I think it will increase the efficiency and avoid out of memory if you close this session after using it.

Here are two files to support this issue,support1 and support2

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

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.