Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the bug where not all PNG files for each stimulus are being saved. #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__pycache__/
*.py[cod]
*$py.class

output/
*.png

venv/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ The following parameters can be changed from the command line to customise the s
--rng_trx range of translation along x
--rng_try range of translation along y
--rng_rota range of rotation transformation

## Notes
On Unix or MacOS, you should install **libcairo2** and **libcairo2-dev**.
4 changes: 4 additions & 0 deletions README.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ The following parameters can be changed from the command line to customise the s
--rng_try range of translation along y
--rng_rota range of rotation transformation
</code>

===== Notes =====

On Unix or MacOS, you should install libcairo2 and libcairo2-dev.
2 changes: 1 addition & 1 deletion paint_studio/painter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def makeStimulus(img,FLAGS,idces,valueDict,centre,stim_shape,ctx,imgID):
tmp = np.frombuffer(img.get_data(),np.uint8)
tmp.shape = [FLAGS.canvas_size[0],FLAGS.canvas_size[1],4]
tmp = tmp[:,:,0:3]
img.write_to_png('img_' + FLAGS.name[0] + '.png')
img.write_to_png(FLAGS.outdir + 'img_' + FLAGS.name[0] + "_" + stim_shape + "_"+str(imgID)+"_" + '.png')
return ctx,tmp,img


Expand Down
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
python==3.6.1
matplotlib==2.0.2
numpy==1.12.1
scipy==0.19.0
pycairo==1.13.3
matplotlib
numpy
scipy
pycairo