USRBIN to RTDOSE converter can't read RTDOSE

Thanks David, and I also set RTDOSE and RTPLAN in the Parameters, but report error.

Started 2020.07.20 13:58:34
- Processing: phatom_99.dcm
Cmd: /usr/local/flair/ --usrbin phatom_99.bnn --det 1 --rtdose RD.dcm --rtplan RP.dcm --output phatom_99.dcm

e> ERROR: Cannot open RTDOSE ‘RD.dcm’
‘NoneType’ object has no attribute ‘read_file’
Usrbin: phatom_99.bnn
e> ERROR: cannot access file ‘phatom_99.dcm’
Maybe the run is still going on?
Error processing: phatom_99.dcm
Ended: 2020.07.20 13:58:34
Possible errors: phatom_99.dcm
Correctly processed:

It seems my RD.dcm can not be read? But the dicom module can display dose very well.
I check the code, it may cause by this line:

Load dicom files

log.say(f"RTDOSE: {rtdose_file}")
	*rtdose = pydicom.read_file(rtdose_file, force=True)*
except Exception as ex:
	log.error(f"Cannot open RTDOSE {rtdose_file!r}")
	return False


After pydicom manully installed, also report error:

Dose Summation Type PLAN

e> ERROR: Cannot handle DoseSummationType=PLAN

Hi @YuniWang2020
thank you for reporting it the problem.
Could you try the following to convert to RTDOSE:

  1. go to the Dicom tab
  2. select an RTDOSE file that it is similar to the USRBIN file
  3. Click on the Import -> USRBIN
    It should create an RTDOSE equivalent file embedding the USRBIN as pixel data, and with an instance number 100+InstanceNumber of the original file
1 Like

Thanks @vasilis, I try these steps and report error:

Started 2020.07.24 11:17:56
Usrbin: /home/fluka/FLUKAwork/DICOM/phatom_99.bnn
RTDOSE: /home/fluka/FLUKAwork/DICOM/Test/RD.dcm
>e> ERROR: Cannot open RTDOSE ‘/home/fluka/FLUKAwork/DICOM/Test/RD.dcm’

  •       'NoneType' object has no attribute 'read_file'*

here is the usrbin file and rtdose: (2.2 MB)

@YuniWang2020 sorry for the late reply.

Did you try to include a CT file in your project?
I saw that flair gives this error if it cannot find the CT file in order to orientate your RTDOSE

When I loaded a dummy CT file for me it worked ok.

I’ve put now a protection if a CT is not present and it gives a warning. It will be in the next release

Dear @vasilis :slight_smile:
Many thanks for your reply, My flair updates to 3.1-3 and I do have CT and RTdose files in my data set:
but still can not convert USRBIN to RT dose:

Started 2020.09.03 13:38:45
Usrbin: /home/fluka/FLUKAwork/DICOM/phatom_99.bnn
RTDOSE: /home/fluka/FLUKAwork/DICOM/Test/RD.dcm

e> ERROR: Cannot open RTDOSE ‘/home/fluka/FLUKAwork/DICOM/Test/RD.dcm’
‘NoneType’ object has no attribute ‘read_file’

It may be my test dicom file is too old? Raystation provided this dicom set for my fluka test, it shows the time is 2009.


@YuniWang2020 I would prefer to fix it no matter if your dicom is old.
Could you try to move the RD.dcm file in the same directory that phantom_99.bnn is located?

@vasilis In the same folder also do not work, as well as copy .bnn to dicom folder. thus I send you these files by email: (104.25MB). May help to debug.

Many thanks Yuni for the bug report. You can find a testing version in the beta download directory of flair

Dear Vasilis:
It seems flair can not work after rpm beta version installed:

My system is ubuntu 18.04. also try to make source file, with error report:


Dear Yuni,

to install from the source you need to install some extra packages in Ubuntu. See 1.3 at Software requirements of FLUKA and Flair


Dear David:
after all packages installed, then make:sudo make install DESTDIR=/home/fluka/FLUKA4.0/Flair/flair-3.1

still not work. :joy:

Dear Yuni,

try the command make clean before compiling and installing again.


Sorry David, still not work. make with no error, but install has same problem. also tried rpm pakage, failed again. I totally set up a new vmware ubuntu 18.04 system to repeat these steps, still not work.
Is the virtual machine cause the problem? but the previous flair version works.

Dear Yuni,

when you are now installing from source you still get the usrbin2dvh: No such file or directory error, or the same with the .rpm package?

If the first, could you try to delete the whole folder of geoviewer, and start over the compilation again?
If the second, that seems to me to be a bug in flair.


Dear David.
everthing deleted before sudo with command: sudo apt remove flair flair-geoviewer:
here is the .rpm install.

this error repoted when start flair. installation seems good.
source make and make install with error, old folders are deleted before unzip a new one:

seems no way to make it.

the changes I’ve made was mostly on the python part, so for your testing you don’t really need to compile the geoviewer but you can expand the flair…tgz in some directory and copy or symbolic link the files, usrbin2dvh, fonts/* from the default installation of flair e.g.
Imagine on your home folder

tar xzvf flair-3.1-4a.tgz
cd flair-3.1
ln -sf /usr/local/flair/ .
ln -sf /usr/local/flair/usrbin2dvh .
ln -sf /usr/local/flair/fonts .

When you run you will get some warning on mismatching geoviewer version, but is not a problem for the testing

Dear Vasilis: I do with these steps:

  1. excute soft links:

  2. then dvh can not display:

  3. when try to convert error report:

File “/usr/local/flair/”, line 1517, in roiShow
File “/usr/local/flair/”, line 1582, in _addROI
array[:,:,iZ] = np.array(img)
ValueError: could not broadcast input array from shape (335,187) into shape (187,335)
Traceback (most recent call last):
File “/usr/local/flair/”, line 1276, in call
return self.func(*args)
File “/usr/local/flair/”, line 1517, in roiShow
File “/usr/local/flair/”, line 1582, in _addROI
array[:,:,iZ] = np.array(img)
ValueError: could not broadcast input array from shape (335,187) into shape (187,335)
Usrbin: /home/fluka/FLUKAwork/dicom/fluka/dicom_99.bnn
RTDOSE: /home/fluka/FLUKAwork/dicom/RD1.2.752.

e> ERROR: Cannot open RTDOSE ‘/home/fluka/FLUKAwork/dicom/RD1.2.752.’
‘NoneType’ object has no attribute ‘read_file’

  1. so I add anothter link:
    ln -sf /usr/local/flair/ ~/FLUKA4.0/Flair/flair-3.1/
    but has the same error.

Hi @YuniWang2020
sorry for the late reply, I am still searching, since I cannot re-produce the error on my machine.