- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]

From: Bunde, Kermit A <bundeka_at_id.doe.gov>

Date: Tue, 9 Oct 2018 13:34:59 +0000

You could try this fortran file:

program readdata

* Programme to read the voxel phantom data from ASCII file

* AF.dat and store them in a three-dimensional array of

* organ identification numbers

dimension norgin(300),nodum(16),noid(300,200,350)

* Number of columns, rows and slices:

ncol=299

nrow=137

nsli=348

open (10,file='AF.dat')

open (20,file='AF.out')

* Read phantom file, assign organ identification numbers to

* array positions

* The organ identification numbers are stored in portions of 16,

* but the number of columns is not a multiple of 16.

* Therefore, when ncol OIDs are read, this ends right in the

* middle of a line, and the rest is ignored. Therefore, the next

* "read" statement has to account for this; the last line that

* has been read only partially, has to be read again, whereby

* that first part that has been registered already needs to be

* skipped. Therefore, the number "ndum" of these items has to be

* tracked.

write (6,'('' Reading of phantom file started'')')

nrorea=ncol/16

ndifcol=ncol-16*nrorea

ndum=0

do 40 nsl=1,nsli

do 40 nr=1,nrow

if (ndum.ne.0) then

backspace (10)

read (10,*) (nodum(i),i=1,ndum), (norgin(i),i=1,ncol)

else

read (10,*) (norgin(i),i=1,ncol)

endif

do 30 nc=1,ncol

noid(nc,nr,nsl)=norgin(nc)

30 continue

ndum=ndum+ndifcol

if (ndum.ge.16) ndum=ndum-16

40 continue

Write (20,'("phantom file") ')

Write (20,'("number of columns",i4," rows", I5,"slices",i5)') ncol, crow,nsli

Do 50 nc=1,ncol

Do 50 nr=1,rnow

Write (20,'(348i4)')(noid(nc,nr,nsl),nsl=1,nsli)

50 continue

write (6,'('' ... finished'')')

close (10)

close (20)

end

Kermit Bunde

From: owner-fluka-discuss_at_mi.infn.it <owner-fluka-discuss_at_mi.infn.it> On Behalf Of Ševcik Aleksandras

Sent: Sunday, October 07, 2018 2:45 AM

To: fluka-discuss_at_fluka.org

Subject: [fluka-discuss]: phantom problem - fortran code

Dear experts,

Despite that I have been able to successfully convert icrp phantom to fluka vxl and it works with some correction, I still need to understand one tricky moment here which, unfortunately, could not being solved by my own for a long time.

In the ICRP's data readme.txt states the following, see below. My problem is that I cannot open original .dat file with imageJ with parameters col 299 row137 sli348 which means that original .dat file is not build in such way so it must be altered as readme.txt states. I can understand basically what this code tries to do, and I can successfully compile and run it, however, nothing changes in that .dat file, i.e. it is not stored in the (299x137x348) array! Does this code lacks some output parameter or smth?

"The organ identification numbers are stored in portions of 16, but the number of columns is not a multiple of 16. Therefore, appropriate care has to be applied for reading the data. As an example, a FORTRAN programme that reads the data of the female reference computational phantom and stores them into a (299 x 137 x 348) array is given in the following:

program readdata

* Programme to read the voxel phantom data from ASCII file

* AF.dat and store them in a three-dimensional array of

* organ identification numbers

dimension norgin(300),nodum(16),noid(300,200,350)

* Number of columns, rows and slices:

ncol=299

nrow=137

nsli=348

open (10,file='AF.dat')

* Read phantom file, assign organ identification numbers to

* array positions

* The organ identification numbers are stored in portions of 16,

* but the number of columns is not a multiple of 16.

* Therefore, when ncol OIDs are read, this ends right in the

* middle of a line, and the rest is ignored. Therefore, the next

* "read" statement has to account for this; the last line that

* has been read only partially, has to be read again, whereby

* that first part that has been registered already needs to be

* skipped. Therefore, the number "ndum" of these items has to be

* tracked.

write (6,'('' Reading of phantom file started'')')

nrorea=ncol/16

ndifcol=ncol-16*nrorea

ndum=0

do 40 nsl=1,nsli

do 40 nr=1,nrow

if (ndum.ne.0) then

backspace (10)

read (10,*) (nodum(i),i=1,ndum), (norgin(i),i=1,ncol)

else

read (10,*) (norgin(i),i=1,ncol)

endif

do 30 nc=1,ncol

noid(nc,nr,nsl)=norgin(nc)

30 continue

ndum=ndum+ndifcol

if (ndum.ge.16) ndum=ndum-16

40 continue

write (6,'('' ... finished'')')

close (10)

end"

__________________________________________________________________________

You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

Received on Tue Oct 09 2018 - 16:49:46 CEST

Date: Tue, 9 Oct 2018 13:34:59 +0000

You could try this fortran file:

program readdata

* Programme to read the voxel phantom data from ASCII file

* AF.dat and store them in a three-dimensional array of

* organ identification numbers

dimension norgin(300),nodum(16),noid(300,200,350)

* Number of columns, rows and slices:

ncol=299

nrow=137

nsli=348

open (10,file='AF.dat')

open (20,file='AF.out')

* Read phantom file, assign organ identification numbers to

* array positions

* The organ identification numbers are stored in portions of 16,

* but the number of columns is not a multiple of 16.

* Therefore, when ncol OIDs are read, this ends right in the

* middle of a line, and the rest is ignored. Therefore, the next

* "read" statement has to account for this; the last line that

* has been read only partially, has to be read again, whereby

* that first part that has been registered already needs to be

* skipped. Therefore, the number "ndum" of these items has to be

* tracked.

write (6,'('' Reading of phantom file started'')')

nrorea=ncol/16

ndifcol=ncol-16*nrorea

ndum=0

do 40 nsl=1,nsli

do 40 nr=1,nrow

if (ndum.ne.0) then

backspace (10)

read (10,*) (nodum(i),i=1,ndum), (norgin(i),i=1,ncol)

else

read (10,*) (norgin(i),i=1,ncol)

endif

do 30 nc=1,ncol

noid(nc,nr,nsl)=norgin(nc)

30 continue

ndum=ndum+ndifcol

if (ndum.ge.16) ndum=ndum-16

40 continue

Write (20,'("phantom file") ')

Write (20,'("number of columns",i4," rows", I5,"slices",i5)') ncol, crow,nsli

Do 50 nc=1,ncol

Do 50 nr=1,rnow

Write (20,'(348i4)')(noid(nc,nr,nsl),nsl=1,nsli)

50 continue

write (6,'('' ... finished'')')

close (10)

close (20)

end

Kermit Bunde

From: owner-fluka-discuss_at_mi.infn.it <owner-fluka-discuss_at_mi.infn.it> On Behalf Of Ševcik Aleksandras

Sent: Sunday, October 07, 2018 2:45 AM

To: fluka-discuss_at_fluka.org

Subject: [fluka-discuss]: phantom problem - fortran code

Dear experts,

Despite that I have been able to successfully convert icrp phantom to fluka vxl and it works with some correction, I still need to understand one tricky moment here which, unfortunately, could not being solved by my own for a long time.

In the ICRP's data readme.txt states the following, see below. My problem is that I cannot open original .dat file with imageJ with parameters col 299 row137 sli348 which means that original .dat file is not build in such way so it must be altered as readme.txt states. I can understand basically what this code tries to do, and I can successfully compile and run it, however, nothing changes in that .dat file, i.e. it is not stored in the (299x137x348) array! Does this code lacks some output parameter or smth?

"The organ identification numbers are stored in portions of 16, but the number of columns is not a multiple of 16. Therefore, appropriate care has to be applied for reading the data. As an example, a FORTRAN programme that reads the data of the female reference computational phantom and stores them into a (299 x 137 x 348) array is given in the following:

program readdata

* Programme to read the voxel phantom data from ASCII file

* AF.dat and store them in a three-dimensional array of

* organ identification numbers

dimension norgin(300),nodum(16),noid(300,200,350)

* Number of columns, rows and slices:

ncol=299

nrow=137

nsli=348

open (10,file='AF.dat')

* Read phantom file, assign organ identification numbers to

* array positions

* The organ identification numbers are stored in portions of 16,

* but the number of columns is not a multiple of 16.

* Therefore, when ncol OIDs are read, this ends right in the

* middle of a line, and the rest is ignored. Therefore, the next

* "read" statement has to account for this; the last line that

* has been read only partially, has to be read again, whereby

* that first part that has been registered already needs to be

* skipped. Therefore, the number "ndum" of these items has to be

* tracked.

write (6,'('' Reading of phantom file started'')')

nrorea=ncol/16

ndifcol=ncol-16*nrorea

ndum=0

do 40 nsl=1,nsli

do 40 nr=1,nrow

if (ndum.ne.0) then

backspace (10)

read (10,*) (nodum(i),i=1,ndum), (norgin(i),i=1,ncol)

else

read (10,*) (norgin(i),i=1,ncol)

endif

do 30 nc=1,ncol

noid(nc,nr,nsl)=norgin(nc)

30 continue

ndum=ndum+ndifcol

if (ndum.ge.16) ndum=ndum-16

40 continue

write (6,'('' ... finished'')')

close (10)

end"

__________________________________________________________________________

You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

Received on Tue Oct 09 2018 - 16:49:46 CEST

*
This archive was generated by hypermail 2.3.0
: Tue Oct 09 2018 - 16:49:50 CEST
*