The code provided here reproduces the figures from the paper:
- Dmitruk, E., Bajno, B., Dreszer, J., Bałaj, B., Ratajczak, E., Hajnowski, M., Janik, R. A., Kuś, M., Kadir, S. N., & Rogala, J.: Art’s Hidden Topology: A window into human perception (p. 2024.10.16.618741). bioRxiv.
The code was written by Emil Dmitruk*, and the underlying ideas are the result of joint work with Shabnam Kadir(*), Jacek Rogala and Marek Kuś.
This code base is using the Julia Language and DrWatson to make a reproducible scientific project named
arttoppaper
- Download this code base. Notice that raw data are typically not included in the
git-history and may need to be downloaded independently.
- raw data should be placed in under "data/exp_raw"
- Open the terminal and navigate to the downloaded repository
- Run Julia in the terminal and run the following:
julia> ] (julia-version) pkg> add DrWatson # install globally, for using `quickactivate` (julia-version) pkg> activate . (ArtTopology) pkg> instantiate
Please note that the first line uses a closing square bracket to activate Julia's package manager.
The last step will install all the packages necessary to run most of the scripts. However, 1 additional dependency is required to run the code (please see below).
- Python in version 3 with Numpy version 2.0 and above
Note: The DrWatson package ensures that all the file management should work out of the box, using repository structure for navigation.
All images must be converted into grayscale before being used in the repository.
This can be done with the script scripts/0a_convert_samples_to_bw.jl. In order
to utilise the automation of the script for a dataset, it is advised to do the following:
- Add a dataset to folder
data/exp_rawunder some name, e.g.artandpseudoart - Add a tuple with the dataset name to the configuration file
scripts/config.jlunder "Datasets paths configuration" and add it to theraw_pathsvariable (please see that file for 2 samples that were used in the paper). - Run the conversion script as
julia scripts/0a_convert_samples_to_bw.jl --data_set dataset1 --data_config BWto run the conversion to grayscale (optionally, BW could be changed to WB to
create inversed, greyscale of the image, which is required for some scripts).
- this loads files from
data/exp_raw/dataset1 - results are saved in
data/exp_pro/img_initial_preprocessing/dataset1
Figures from the paper can be obtained by executing the scripts, e.g. the following code:
julia scripts/2gd2_makie_average_landscapes_comparison_all_landscapes.jl --data_set pseudoart --data_config BWwill provide figures presented in Figure 14. Option dataset determines which images will be
used from the paper. Option data_config determines which filtration will be used
(please see src/ArgsParsing.jl for all details about the arguments for the scripts).
Please use the list below to obtain desired figures.
List of figures that were produced with scripts
- fig 5. Produced with 17g, 17id, 17ie2
- fig 13. Produced with 2f3b2
- fig 14. Produced with 2gd2
- fig 15. Produced with 2m4
- fig 16. Produced with 17ig3lb2
- fig 17. Produced with 17jg3k2
List of Supplementary figures that were produced with scripts
- Supplementary fig 3. Produced with 2f3b2
- Supplementary fig 4. Produced with 2f3b2
- Supplementary fig 5. Produced with 2m4
- Supplementary fig 6. Produced with 2f3f
- Supplementary fig 7. Produced with 2gb2a
- Supplementary fig 8. Produced with 12c2
- Supplementary fig 9. Produced with 17g
- Supplementary fig 10. Produced with 17g
- Supplementary fig 11. Produced with 17g
- Supplementary fig 12. Produced with 17g
- Supplementary fig 13. Produced with 2f3hb
- Supplementary fig 14. Produced with 2f3hb
- Supplementary fig 15. Produced with 2f3hb
- Supplementary fig 16. Produced with 2f3hb
- Supplementary fig 17. Produced with 2f3hb
- Supplementary fig 18. Produced with 2f3hb
- Supplementary fig 19. Produced with 2f3hb
- Supplementary fig 20. Produced with 2f3hb
- Supplementary fig 21. Produced with 2n3a
- Supplementary fig 22. Produced with 2n3a
- Supplementary fig 23. Produced with 2n3a
- Supplementary fig 24. Produced with 2n3a
- Supplementary fig 25. Produced with 2n3b
- Supplementary fig 26. Produced with 2n3b
- Supplementary fig 27. Produced with 17h4
- Supplementary fig 28. Produced with 17ig2g and 17jg2g
- Supplementary fig 29. Produced with 17ig2g and 17jg2g
- Supplementary fig 30. Produced with 17ig2g and 17jg2g
- Supplementary fig 31. Produced with 17ig3da
- Supplementary fig 32. Produced with 17ig3da
- Supplementary fig 33. Produced with 17ig3da
To run code from the section 17, Python has to be installed, together with a Numpy library- an error will be thrown if Numpy is not available. If this happens, please follow the instructions provided in the message.
Please note that those computations are may take a while and the saved intermidiate results may take a lot of disk space.