How do I install the montaging remote module so that I can use it in my Python virtual environment?

Hello,

I created a Python virtual environment and ran these commands:

pip install itk
pip install itk-montage

However, when I try to create a TileMontage in my code

import itk

montage = itk.TileMontage.New()

it fails with the following error:

Exception has occurred: AttributeError
module 'itk' has no attribute 'TileMontage'

I then decided to run dir(itk) to see what all is available, and TileMontage isn’t in the list. Neither is MedianImageFilter, which is another filter I wanted to use.

However, if I run the commands to try installing the itk and itk-montage modules again, I get this output:

(pyIFAM) Blackbird:pyIFAM joeykleingers$ pip install itk
Requirement already satisfied: itk in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk-5.2rc1-py3.8-macosx-10.9-x86_64.egg (5.2rc1)
Requirement already satisfied: itk-core==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_core-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: itk-filtering==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_filtering-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: itk-io==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_io-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: itk-numerics==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_numerics-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: itk-registration==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_registration-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: itk-segmentation==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_segmentation-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk) (5.2rc1)
Requirement already satisfied: numpy in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/numpy-1.20.1-py3.8-macosx-10.9-x86_64.egg (from itk) (1.20.1)

(pyIFAM) Blackbird:pyIFAM joeykleingers$ pip install itk-montage
Requirement already satisfied: itk-montage in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_montage-0.7.0-py3.8-macosx-10.9-x86_64.egg (0.7.0)
Requirement already satisfied: itk-core>=v5.1.1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_core-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk-montage) (5.2rc1)
Requirement already satisfied: itk-filtering>=v5.1.1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_filtering-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk-montage) (5.2rc1)
Requirement already satisfied: itk-io>=v5.1.1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_io-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk-montage) (5.2rc1)
Requirement already satisfied: numpy in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/numpy-1.20.1-py3.8-macosx-10.9-x86_64.egg (from itk-montage) (1.20.1)
Requirement already satisfied: itk-numerics==5.2rc1 in /Users/joeykleingers/.conda/envs/pyIFAM/lib/python3.8/site-packages/itk_numerics-5.2rc1-py3.8-macosx-10.9-x86_64.egg (from itk-filtering>=v5.1.1->itk-montage) (5.2rc1)

How do I use the montaging classes in my Python code? What am I missing?

Indeed, we don’t have a Python example for Montage yet. I have a lot of work planned for this week, I might be able to get to it next week. Meanwhile you could be inspired by the code in this issue.

I just tried it with a brand new Anaconda environment, and I am able to list the various montage modules just like the person in the issue, so they appear to be installed. So now just need to figure out how to actually use the montage modules.

1 Like

If you accomplish it before I get to it, it would be great if you added it as a new example in GitHub, or alternatively share here.