[Neuroimaging] ml on medical images - keras

Matthew Brett matthew.brett at gmail.com
Mon Jul 11 04:56:26 EDT 2022


Hi,

‪On Sun, Jul 10, 2022 at 11:02 AM ‫נתי שטרן‬‎ <nsh531 at gmail.com> wrote:‬
>
> p.s. all the pictures are in PNG FORMAT
>
> ‫בתאריך יום א׳, 10 ביולי 2022 ב-13:01 מאת נתי שטרן <‪nsh531 at gmail.com‬‏>:‬
>>
>> What's the problem on this code:
>>
>> import os
>> from pickletools import float8, uint8
>> from PIL import Image
>>
>> import numpy as np
>> import tensorflow as tf
>> from tensorflow import keras
>> from tensorflow.keras import layers
>> inputs=[]
>> for i in os.listdir("c:/inetpub/wwwroot/out"):
>>     for j in os.listdir("c:/inetpub/wwwroot/out/"+i+"/"):
>>             A=Image.open("c:/inetpub/wwwroot/out/"+i+"/"+j)
>>             from matplotlib import pyplot as plt
>>
>>             filename = 'image-test'
>>
>>
>>           #  img = ( filename + '.png' )
>>             x=np.array(A,dtype=np.shape(A))
>>             inputs.append(x)
>>
>> simple_rnn = tf.keras.layers.SimpleRNN(4)
>> #np.int
>> output = simple_rnn(inputs=np.array(inputs,dtype=np.ndarray(260, 730, 4)))  # The output has shape `[32, 4]`.
>>
>> simple_rnn = tf.keras.layers.SimpleRNN(
>>     4, return_sequences=True, return_state=True)
>>
>> # whole_sequence_output has shape `[32, 10, 4]`.
>> # final_state has shape `[32, 4]`.
>> whole_sequence_output, final_state = simple_rnn(inputs)

You don't give an error message I can see - but in any case - it seems
to me this is a Tensorflow question, not a Nibabel / Neuroimaging
question.  You could try asking on a Tensorflow list - but again - for
the best chance of a useful answer, please consider following the
advice at:

http://catb.org/%7Eesr/faqs/smart-questions.html

Cheers,

Matthew


More information about the Neuroimaging mailing list