-2

i installed simpleitk in anaconda using command conda install -c simpleitk simpleitk then followed link https://github.com/SimpleITK/SimpleITKCondaRecipe to build it but it's not connecting to itk.org to build. import SimpleITK as sitk on jupyter notebook is working but sitk.show() is not working. moreover when i tried to follow the commands from http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/00_Setup.html, from downloaddata import fetch_data, fetch_data_all not working. even the command fetch_data_all(os.path.join('..','Data'), os.path.join('..','Data','manifest.json')) is not working. i am very new to simpleitk and don't know whether it is due to build not processed. please tell me how to solve my problems. i have been trying from many days, pl help me. moreover how to make imagej as default for simpleitk. i know lots of questions but i would be greatful if solved.

anita dhawan
  • 1
  • 1
  • 2

1 Answers1

0

You seem to be having multiple problems, all of which have to do with installing a working environment and less specific to SimpleITK.

  1. You installed SimpleITK using the conda install command, so there was no need to build it using the conda build command. Check that you have it installed correctly and see which version you have:

    import SimpleITK as sitk print(sitk.Version())

  2. The functions fetch_data and fetch_data_all are part of a module found in the SimpleITK notebooks repository. To use the code from that repository you will need to clone it using git:

git clone https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks.git

Then you can run the notebooks or copy the relevant modules to your directory and work with them there.

  1. The sitk.Show() command assumes that you have the ImageJ/Fiji program installed which is likely why it is not working (I am guessing here as you did not provide sufficient detail).
zivy
  • 521
  • 2
  • 2
  • 1. sitk.Show(img) is giving message : C:\Users\anita\Anaconda2\lib\site-packages\SimpleITK-0.9.1-py2.7-win-amd64.egg\SimpleITK\SimpleITK.pyc in Show(*args, **kwargs) 7247 7248 """ -> 7249 return _SimpleITK.Show(*args, **kwargs) 7250 class ImageFileWriter(ProcessObject): 7251 """ RuntimeError: Exception thrown in SimpleITK Show: ..\..\..\..\..\Users\dashboard\Anaconda-64\conda-bld\work\Code\IO\src\sitkShow.cxx:463: sitk::ERROR: Error in administrating child process: [The parameter is incorrect] – anita dhawan Dec 01 '17 at 08:24
  • 2. should i copy/paste python folder of simpleitk-notebook into anaconda site packages? do you mean this by "relevant modules to your directory" 3. also slice = sitk.GetArrayViewFromImage(im)[z,:,:] plt.imshow(slice) says no module GetArrayViewFromImage found but import matplotlib works – anita dhawan Dec 01 '17 at 09:12
  • sir i solved my imagej default view problem by setting SITK_SHOW_COMMAND variable. pl guide me about rest of the problems – anita dhawan Dec 01 '17 at 11:33
  • You seem to be struggling with Python concepts. You do not copy anything into the anaconda site packages directory. You can copy the relevant *.py files from the SimpleITK notebook directory to the directory where you are working. Each of these *.py files is a module. The GetArrayViewFromImage is a SimpleITK function (SimpleITK version 1.0.1). What version did you install? – zivy Dec 02 '17 at 14:21
  • i am using simpleitk version 0.9.1 – anita dhawan Dec 04 '17 at 06:57
  • one more thing. fetch_data_all(os.path.join('..','Data'), os.path.join('..','Data','manifest.json')) says 'os' not defined. i already copied all .py and also data/manifest.json into anaconda2 folder. even sitk.Show(sitk.ReadImage(fetch_data("SimpleITK.jpg"))) says data\manifest not found when it is under Anacoda2\dat\manifets.json – anita dhawan Dec 04 '17 at 08:55
  • Please install SimpleITK version 1.0.1 as this is the current stable release which has all the features used in the notebooks. With regard to 'os' this is a standard Python module, you are simply missing 'import os' in your file. I would strongly suggest getting up to speed in Python before attempting to do advanced image analysis. – zivy Dec 05 '17 at 14:46
  • @zivy- yes i followed data camp for python n still learning. actually i work on matlab and commands are quite same, format different. one more thing, i am following http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/03_Image_Details.html to learn but i don't understand what is readme.txt of dicom series. i have a folder containing dicom images but no text file. so how to read the image series? – anita dhawan Dec 06 '17 at 05:14
  • when i do conda install SimpleITK=1.0.1, it says this version is not in anaconda channel. if i install using github, will i have to build manually? – anita dhawan Dec 06 '17 at 08:26
  • also when i write img_T1 = sitk.ReadImage(fdata("C://users/anita/Desktop/lung11.jpg")), it says AssertionError: ERROR, ../Data\manifest.json does not exist kindly guide – anita dhawan Dec 06 '17 at 10:26
  • no reply ??? i want to do airways and vessel segmentation of CT lung slice set and then volume rendering. kindly suggest me if all this is possible with SimpleITK. i can work hard but want to know whether i am going in right direction. noone to guide here – anita dhawan Dec 21 '17 at 05:59