1
import os
import sys
import numpy as np
import scipy
import pylab
import pymorph
import mahotas
import matplotlib.pyplot as plt
import Image

from scipy import ndimage
from pymorph import regmax
from PIL import Image




path='all_images'


for file in os.listdir(path):
    current = os.path.join(path, file)
    extension = os.path.splitext(current)[-1]
    fileType = extension.upper()
    print(current)

    if os.path.isfile(current):
        img = mahotas.imread(current)
        imgf = ndimage.gaussian_filter(img, 8)
        pylab.gray()
        imgf.save('dnaa.gif')

Can not save file using the below python code. Error: numpy.ndarray object has no attribute 'save'. Can anyone help how to save file using pylab. I guss the last line of the code has some issue.

1
  • In the future it is better to include the full trace back. Commented Nov 29, 2013 at 6:33

1 Answer 1

3

Use mahotas.imsave('dnaa.gif', imgf) instead. The NumPy array you get from gaussian_filter doesn't have save functionality built in.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.