# How can loop through a image folder?

**URL:** https://discourse.julialang.org/t/how-can-loop-through-a-image-folder/60906
**Category:** New to Julia
**Tags:** question
**Created:** [May 10, 2021, 5:54pm UTC](https://discourse.julialang.org/t/how-can-loop-through-a-image-folder/60906 "2021-05-10T17:54:34Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![assia855](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/assia855/32/22845_2.png) [@assia855](https://discourse.julialang.org/u/assia855)
#### Post date: [May 10, 2021, 7:13pm UTC](https://discourse.julialang.org/t/how-can-loop-through-a-image-folder/60906/6 "2021-05-10T19:13:27Z")

</div>

I have a folder full of fits images. I would like to iterate through each image in file. I already write this code. I would like to improve it. please help.

```julia
DISK = glob("SyntheticData/int_a_*.fits")
Iu = Array{Float64,3}[]
Ip = Array{Float64,3}[]
Theta = Array{Float64,3}[]

it = 1
for DISKS in DISK
    Iu[:,:,it] =gain .* DISKS[:,:,1];
    Ip[:,:,it] =gain .* DISKS[:,:,2];
    Theta[:,:,it] =DISKS[:,:,3];
    global it+=1;
end
end

```

---

_[View the full topic](https://discourse.julialang.org/t/how-can-loop-through-a-image-folder/60906)._
