Particle Analysis Problem

I am struggling a bit with particle analysis in IP7.
I have two waves
Wave: ZD
Type: Double Float 64 bit
Rows: 960 Start: 0 Delta: 0.258 Units:
Columns: 1281 Start: 0 Delta: 0.258 Units:

Wave: TipROI
Type: Unsigned Byte 8 bit
Rows: 960 Start: 0 Delta: 0.258 Units:
Columns: 1281 Start: 0 Delta: 0.258 Units:

I have used copy commands to get the following and renamed the input and ROI wave.
When I run this it produces
Wave: M_ImageThresh
Type: Double Float 64 bit
Rows: 960 Start: 0 Delta: 0.258 Units:
Columns: 1281 Start: 0 Delta: 0.258 Units:

But the type is double instead of binary which causes the Image AnalyzeParticles to throw an error because of the wrong type. I commented it out as part of trouble shooting.
Function WMAnalyzeParticles2(ZD,TipRoi)
    Wave ZD,TipRoi
   
    ImageThreshold /M=2/i /R=TipRoi  ZD
    Wave M_ImageThresh
    //ImageAnalyzeParticles/D=ZD /W/E/A=4/R=TipRoi  stats M_ImageThresh
End


This works fine with WMAnalyzeParticles(ZD)
Function WMAnalyzeParticles(inWave)
    Wave inWave
   
    ImageThreshold /M=0/i /T=(Wavemax(inWave)-2) inWave
    Wave M_ImageThresh
    ImageAnalyzeParticles/D=inWave /m=3 /W/E/A=4 stats M_ImageThresh
End



Where am I going wrong?
Made some progress, the specification of the ROI wave has to be changed from the copy command function to include a forcing function outside the ROI to make the M_ImageThresh binary otherwise the region outside the ROI was copy from the original image which in my case was double float type.
Function WMAnalyzeParticles2(ZD,TipRoi)
    Wave ZD,TipRoi
   
    ImageThreshold /M=2/i /R={TipRoi,0}  ZD //this needed changing
    Wave M_ImageThresh
    ImageAnalyzeParticles/D=ZD /W/E/A=4/R=TipRoi  stats M_ImageThresh
End