FNNDSC / med2image

Converts medical images to more displayable formats, e.g. NIfTI to jpg.
MIT License
188 stars 56 forks source link

Variable names #30

Closed sevimcengiz closed 4 years ago

sevimcengiz commented 4 years ago

Hello,

When I run this code, it works: !med2image -i /content/BetBrain/Bet_P1.nii.gz -d /content/BetBrainPNG -o Bet_P1.png -s -1

I have lots of nii files that need to be converted into png files. So, I want to use variable name for path and file name in for loop. However, when I try to use variable, it gives me the error given below:

The code that I run:

image_name = '/content/BetBrain/Bet_P1.nii.gz' png_name = 'Bet_P1.png' print(image_name) print(png_name) !med2image -i image_name -d /content/BetBrainPNG -o png_name -s -1

This is the error: Traceback (most recent call last): File "/usr/local/bin/med2image", line 290, in imgConverter = med2image.object_factoryCreate(args).C_convert AttributeError: 'object_factoryCreate' object has no attribute 'C_convert'

Probably the code only needs path or file directly without using variable name or file because when I use variable, it uses this variable as a path or file. Therefore, it doesn't find the file.

Any help to use variable names and paths in this code will be great.

sevimcengiz commented 4 years ago

Problem solved. I found that it was related to environment.

Jessejx commented 3 years ago

Problem solved. I found that it was related to environment.

I also found this problem, how did you solve it?

Jessejx commented 3 years ago

Problem solved. I found that it was related to environment.

I also found this problem, how did you solve it?

I have solved this problem and thank you